Weer een error!

Gestart doorDylan23 reacties30 weergaven

24 berichten · pagina 1 van 2

Dylan

Lid · Topicstarter

Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Hoi ik ben bezig om php te leren.. en ik loop nu al vast;
dit is mijn login.php:

[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]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Oeps geen verbinding met de mysql server"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"php"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Kan de database niet vinden!"[/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][COLOR= #0000BB]$numrows[/COLOR][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]

[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= #DD0000]"Je bent ingelogt!!"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Oeps fout wachtwoord"[/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]"Oeps gebruikersnaam is niet gevonden!!"[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$numrows[/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]"Log aub goed in!"[/COLOR][COLOR= #007700]);[/COLOR]
  
?>


en ik krijg:

Parse error: syntax error, unexpected } in C:xampphtdocslogin.php on line 22


ik zie niet wat er mis is op line 22
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
; or die

=>

or die
0
Berichten
3.788
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]"*****"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Oeps geen verbinding met de mysql server"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"php"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Kan de database niet vinden!"[/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]"Log aub goed in!"[/COLOR][COLOR= #007700]);[/COLOR]
  
?>


EDIT:
Hierboven is 5sec eerderwink
0
Dylan

Lid · Topicstarter

Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Eleky schreef:
[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]"*****"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Oeps geen verbinding met de mysql server"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"php"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Kan de database niet vinden!"[/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]"Log aub goed in!"[/COLOR][COLOR= #007700]);[/COLOR]
  
?>
EDIT:
Hierboven is 5sec eerderwink
Bedankt uh wat heb je verandert...

@Niels ik snap niet waar je bedoelt xd
0
Berichten
3.788
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Op regel 9 (en op 10 ook) heb je dit:

"); or die("

Je voert eerst iets met mysql uit, je eindigd met ")
Vervolgens zet je een einde regel teken neer (wink en dan ga je verder, dat klopt er niet.
Het einde regel teken (wink moet ook pas op het eind van de regel, niet halverwege, dus die heb ik weggehaald
0
Dylan

Lid · Topicstarter

Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Oh ok bedankt
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Leer uitlijnen emo
0
Dylan

Lid · Topicstarter

Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
het heeft met die { en } te maken hea
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Ja maar aangezien je niet uitlijnd is het niet te ontdekken yummie
0
Dylan

Lid · Topicstarter

Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Hoe kan je uitlijnen dan?
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Met je vingers biggrin
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Met de o-zo-mooie tab-toets op je toetsenbord.
0
Berichten
12.729
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Erik schreef:
Met de o-zo-mooie tab-toets op je toetsenbord.
Zo mooi is die niet.sadley Maar wel de snelste oplossing.emo
0
Dylan

Lid · Topicstarter

Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Kan iemand voor mij "uitlijnen" xdcry
0
Berichten
160
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dylanh schreef:
Kan iemand voor mij "uitlijnen" xdcry
Ja Adobe DreamWeaver kan dat, maar dat programma is niet gratis, je wel gratis een 30 dagen trial nemen.
Commands -> Apply Source Formatting
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