error, wat is er fout?

Gestart doorJordyvc8 reacties48 weergaven

9 berichten · pagina 1 van 1

Jordyvc

Lid · Topicstarter

Berichten
6.037
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Beste,

ik heb een error in mijn script maar ik weet niet wat het is of wat ik moet doen!
Dit is de eroor:

Parse error: syntax error, unexpected T_STRING, expecting ( in C:xampphtdocslogin.php on line 16


Het enige dat ik weet is dat er iets niet goed is op lijn 16, meer niet!
Weet iemand hoe dit komt en hoe ik dit moet wegdoen!

alvast bedankt nerd
BELANGRIJK:
Spoiler tonen
De eerste krijgt een beloning van 0.05 punten!!!
0
Berichten
15.446
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
kun je een stukje code plaatsen?
(bv van regel 12 t/m 18 ofzo)
0
Jordyvc

Lid · Topicstarter

Berichten
6.037
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
hey,

dit is heel de code:

[COLOR= #0000BB]<?php

$username[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$password[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]];[/COLOR]

[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700]&&[/COLOR][COLOR= #0000BB]$password[/COLOR][COLOR= #007700])
{[/COLOR]

[COLOR= #0000BB]$connect[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"localhost"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"root"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"14april"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Couldnt connect!"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"phplogin"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Couldnt find db!"[/COLOR][COLOR= #007700]);[/COLOR]

[COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users WHERE username=$username"[/COLOR][COLOR= #007700]);[/COLOR]

[COLOR= #0000BB]$numrows[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/if"]if[/URL] numrows[COLOR= #007700]=![/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700])
{[/COLOR]

 [URL="http://www.php.net/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]))
 {[/COLOR]
        [COLOR= #0000BB]$dbusername[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]];[/COLOR]
        [COLOR= #0000BB]$dbpassword[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]];
 }[/COLOR]

 [COLOR= #FF8000]// check to see if they match![/COLOR]
 [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700]==[/COLOR][COLOR= #0000BB]$dbusername[/COLOR][COLOR= #007700]&&[/COLOR][COLOR= #0000BB]$password[/COLOR][COLOR= #007700]==[/COLOR][COLOR= #0000BB]$dbpassword[/COLOR][COLOR= #007700])
 {[/COLOR]
   [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"youre in!"[/COLOR][COLOR= #007700])
 }[/COLOR]
 [URL="http://www.php.net/else"]else[/URL]
     [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"incorrect password!"[/COLOR][COLOR= #007700]);

}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
    [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"That user doenst exist!"[/COLOR][COLOR= #007700]);

}


}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
    [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"please enter a username and a password!"[/COLOR][COLOR= #007700]);[/COLOR]


?>
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Regel 16:
if ($numrows!=0)

Btw leer scripten dit faalt echt emo
0
Berichten
15.446
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php

$username[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$password[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]];[/COLOR]

[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700]&&[/COLOR][COLOR= #0000BB]$password[/COLOR][COLOR= #007700])
{[/COLOR]

[COLOR= #0000BB]$connect[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"localhost"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"root"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"14april"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Couldnt connect!"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"phplogin"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Couldnt find db!"[/COLOR][COLOR= #007700]);[/COLOR]

[COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users WHERE username=$username"[/COLOR][COLOR= #007700]);[/COLOR]

[COLOR= #0000BB]$numrows[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR]numrows[COLOR= #007700]=![/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700])
{[/COLOR]

 [URL="http://www.php.net/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]))
 {[/COLOR]
        [COLOR= #0000BB]$dbusername[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]];[/COLOR]
        [COLOR= #0000BB]$dbpassword[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]];
 }[/COLOR]

 [COLOR= #FF8000]// check to see if they match![/COLOR]
 [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700]==[/COLOR][COLOR= #0000BB]$dbusername[/COLOR][COLOR= #007700]&&[/COLOR][COLOR= #0000BB]$password[/COLOR][COLOR= #007700]==[/COLOR][COLOR= #0000BB]$dbpassword[/COLOR][COLOR= #007700])
 {[/COLOR]
   [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"youre in!"[/COLOR][COLOR= #007700])
 }[/COLOR]
 [URL="http://www.php.net/else"]else[/URL]
     [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"incorrect password!"[/COLOR][COLOR= #007700]);

}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
    [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"That user doenst exist!"[/COLOR][COLOR= #007700]);

}[/COLOR]

[URL="http://www.php.net/else"]else[/URL]
    [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"please enter a username and a password!"[/COLOR][COLOR= #007700]);[/COLOR]


?>


Misschien zo?
0
Jordyvc

Lid · Topicstarter

Berichten
6.037
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Laat maar is al opgelost!!

Toch bedankt!

Kan slotje op!
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Misschien handig om de oplossing te plaatsen?
0
Berichten
970
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ja, zou handig zijn. En trouwens waarom die je het script, terwijl je niks invoert?
0
Berichten
3.314
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Allard schreef:
Ja, zou handig zijn. En trouwens waarom die je het script, terwijl je niks invoert?
Om de rest ook te killen yummie
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren