Heey allemaal!
Ik ben bezig met een loginscript, alleen wil het me niet echt lukken...
Heb de registratiepagina helemaal zelf gemaakt, maar het inloggedeelte heb ik toch echt met een tutorial moeten doen.
(www.zoozio.nl staat het nu op
Dus, ziet iemand hier de fout in?
Alvast bedankt voor jullie hulp!
Ik ben bezig met een loginscript, alleen wil het me niet echt lukken...
Heb de registratiepagina helemaal zelf gemaakt, maar het inloggedeelte heb ik toch echt met een tutorial moeten doen.
(www.zoozio.nl staat het nu op
Dus, ziet iemand hier de fout in?
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"<form method="[/COLOR]post[COLOR= #DD0000]" action=".$_SERVER[[/COLOR]php_self[COLOR= #DD0000]].">
<table border="[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #DD0000]">
<tr>
<td>Gebruikersnaam:</td>
<td><input type="[/COLOR]text[COLOR= #DD0000]" name="[/COLOR]username[COLOR= #DD0000]" size="[/COLOR][COLOR= #0000BB]20[/COLOR]px[COLOR= #DD0000]" value=".$_POST[[/COLOR]username[COLOR= #DD0000]]." /></td>
</tr>
<tr>
<td>Wachtwoord:</td>
<td><input type="[/COLOR]password[COLOR= #DD0000]" name="[/COLOR]password[COLOR= #DD0000]" size="[/COLOR][COLOR= #0000BB]20[/COLOR]px[COLOR= #DD0000]" value=".$_POST[[/COLOR]password[COLOR= #DD0000]]." /></td>
</tr> </table>
<input type="[/COLOR]submit[COLOR= #DD0000]" name="[/COLOR]submit[COLOR= #DD0000]" value="[/COLOR]Inloggen[COLOR= #DD0000]" />
</form>"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$myusername[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$mypassword[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$myusername[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$myusername[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$mypassword[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$mypassword[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$myusername[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$myusername[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$mypassword[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$mypassword[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"SELECT * FROM ledensysteem WHERE username=$myusername and password=$mypassword"[/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]$count[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$count[/COLOR][COLOR= #007700]==[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/session_register"]session_register[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"myusername"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/session_register"]session_register[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"mypassword"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"location:login_success.php"[/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]"Uw gebruikersnaam -wachtwoord combinatie is onjuist, probeer het nog een keer!"[/COLOR][COLOR= #007700];
}[/COLOR]
?> Alvast bedankt voor jullie hulp!