Hallo.
Ik was eventjes bezig met een admin paneeltje voor mijn toekomstige website.
Bij de pagina "admin toevoegen" stuitte ik op een probleem, als je alle velden invult en ook de wachtwoorden hetzelfde hebt, blijft hij zeggen "De wachtwoorden komen niet overeen.".
Ik kon het probleem zelf niet achterhalen.
Het kan het simpelste zijn waar ik altijd overheen kijk .. Maar ja.
Code staat hier onder.
Ik was eventjes bezig met een admin paneeltje voor mijn toekomstige website.
Bij de pagina "admin toevoegen" stuitte ik op een probleem, als je alle velden invult en ook de wachtwoorden hetzelfde hebt, blijft hij zeggen "De wachtwoorden komen niet overeen.".
Ik kon het probleem zelf niet achterhalen.
Het kan het simpelste zijn waar ik altijd overheen kijk .. Maar ja.
Code staat hier onder.
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR]
[COLOR= #0000BB]$submit[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bevestig[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$gebruikersnaam[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strip_tags"]strip_tags[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$wachtwoord[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strip_tags"]strip_tags[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoord[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$wachtwoordherhalen[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/strip_tags"]strip_tags[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoordherhalen[/COLOR][COLOR= #007700]]));[/COLOR]
[COLOR= #0000BB]$email[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strip_tags"]strip_tags[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$submit[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$gebruikersnaam[/COLOR][COLOR= #007700]&&[/COLOR][COLOR= #0000BB]$wachtwoord[/COLOR][COLOR= #007700]&&[/COLOR][COLOR= #0000BB]$wachtwoordherhalen[/COLOR][COLOR= #007700]&&[/COLOR][COLOR= #0000BB]$email[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](([/COLOR][COLOR= #0000BB]$wachtwoord[/COLOR][COLOR= #007700])==([/COLOR][COLOR= #0000BB]$wachtwoordherhalen[/COLOR][COLOR= #007700]))
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$gebruikersnaam[/COLOR][COLOR= #007700])>[/COLOR][COLOR= #0000BB]20[/COLOR][COLOR= #007700]||[/COLOR][URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$gebruikersnaam[/COLOR][COLOR= #007700])<[/COLOR][COLOR= #0000BB]6[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"De gebruikersnaam moet tussen de 6 en 20 karakters bevatten.<p />"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Registratie succesvol.<p />"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"De wachtwoorden komen niet overeen. <p />"[/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]"Het invullen van alle velden is verplicht! <p />"[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<b>Gebruiker toevoegen:</b><p />
<form action=gebruiker_toevoegen.php method=post>
<table>
<tr>
<td><b>Gebruikersnaam</b></td>
<td><input type=text name=gebruikersnaam /></td>
</tr>
<tr>
<td><b>Wachtwoord</b></td>
<td><input type=password name=wachtwoord /></td>
</tr>
<tr>
<td><b>Wachtwoord herhalen</b></td>
<td><input type=password name=wachtwoordherhalen /></td>
</tr>
<tr>
<td><b>Email adres</b></td>
<td><input type=text name=email /></td>
</tr>
</table><p />
<input type=submit name=bevestig value=Bevestigen />
</form>
"[/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]"U moet inloggen om toegang tot deze pagina te krijgen."[/COLOR][COLOR= #007700]);[/COLOR]
?>