inlogsysteem

Gestart doorRaymon5 reacties127 weergaven

6 berichten · pagina 1 van 1

Raymon

Lid · Topicstarter

Berichten
37
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
hiya again,
nu heb ik een inlogsysteem geprobeerd te maken. maar net zoals bij het registratiesysteem. werkt deze niet.
script:

<form action="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$PHP_SELF[/COLOR][COLOR= #007700])[/COLOR]?>" method="post">
<table>
<tr><th colspan="2">Inloggen</th></tr>
<tr>
  <td>gebruikersnaam</td>
  <td><input type="text" name="username" size="15"></td></tr>
<tr>
  <td>wachtwoord</td>
  <td><input type="password" name="password" size="15"></td></tr>
<tr><td></td><td><input type="submit" value="Inloggen"></td></tr>
</table></form> 

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]config.php[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_server[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]POST[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$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]

[COLOR= #0000BB]$connectie[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$server[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$gebruiker[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$wachtwoord[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR] 
[URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$db[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$connectie[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"Kon de database niet selecteren"[/COLOR][COLOR= #007700]);[/COLOR]
        
[COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT password FROM members WHERE username="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]
        
[COLOR= #0000BB]$result[/COLOR][COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$connectie[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][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_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]))
        {[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]$password[/COLOR][COLOR= #007700]){[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]ingelogt[/COLOR][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Foutieve gebruikersnaam en/of wachtwoord.[/COLOR][COLOR= #007700];
}
} 
}[/COLOR]
?>


als iemand de fout zou kunnen vinden.. thnx
0
Berichten
536
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
wat gebeurd er,
krijg je een error?
zo ja, welke?
0
Raymon

Lid · Topicstarter

Berichten
37
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
nee, geen error. eigenlijk helemaal niets. als ik op verzenden druk zegmaar. dan gaat hij zegmaar de pagina herladen. maar doet n iets.
mvg
0
Berichten
2.950
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je script klopt niet, je moet doen

if(msqyl_num_rows($result) == 1)
{

echo Ingelogd;

}
else
{

echo fout;

}
0
Raymon

Lid · Topicstarter

Berichten
37
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
en ruben waar moet ik dit neerzetten?
het werkt al het script hoor. het zat in de $_SERVER method post variabele, die server had ik met kleine letters emo
t is nu ook MD5 beveiligd
0
Berichten
2.950
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ow nvm, ik raad je aan een beetje te gaan uitlijnen enzo, is echt bagger te lezen
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