Hallo iedereen!
Sorry voor weer een topic maar ik kon het zelf na 2 uur zoeken niet vinden.
Ik heb mijn ledensysteem af en ben nu bezig met een script om je wachtwoord te veranderen,
Het is nog niet af,
Maar ik was het aan het debuggen en toen er steeds als ik op submit drukte te staan "Oud wachtwoord is niet correct!" terwijl dit wel zo is.
Het script tot nu toe:
Waat heb ik de fout gemaakt? A.u.b ook zeggen waar !
Sorry voor weer een topic maar ik kon het zelf na 2 uur zoeken niet vinden.
Ik heb mijn ledensysteem af en ben nu bezig met een script om je wachtwoord te veranderen,
Het is nog niet af,
Maar ik was het aan het debuggen en toen er steeds als ik op submit drukte te staan "Oud wachtwoord is niet correct!" terwijl dit wel zo is.
Het script tot nu toe:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]design_top.php[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$user[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$user[/COLOR][COLOR= #007700])
{[/COLOR]
[COLOR= #FF8000]//gebruiker is ingelogd[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]])
{[/COLOR]
[COLOR= #FF8000]//velden checken[/COLOR]
[COLOR= #0000BB]$oldpassword[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]oldpassword[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$newpassword[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]newpassword[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$repeatnewpassword[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]repeatnewpassword[/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]"marklzg47_leden"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"WACHTWOORD"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Cant connect."[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"marklzg47_leden"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Cant find DB"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$queryget[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT password FROM users WHERE username=$users"[/COLOR][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]$queryget[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$oldpasswordb[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #FF8000]//check wachtwoorden[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$oldpassword[/COLOR][COLOR= #007700]==[/COLOR][COLOR= #0000BB]$oldpassworddb[/COLOR][COLOR= #007700])
{[/COLOR]
[COLOR= #FF8000]//check two new passwords[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$newpassword[/COLOR][COLOR= #007700]==[/COLOR][COLOR= #0000BB]$repeatnewpassword[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"SUCCES!!"[/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]"Nieuwe wachtwoorden zijn niet hetzelfde!"[/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]"Oud wachtwoord is niet correct!"[/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]"
<form action=changepassword.php method=POST>
Oud Wachtwoord: <input type=text name=oldpassword><br>
Nieuw Wachtwoord: <input type=password name=newpassword><br>
Herhaal Wachtwoord: <input type=password name=repeatnewpassword><br>
<input type=submit name=submit value=Verander Wachtwoord>
</form>
"[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]design_bottom.php[/COLOR][COLOR= #007700];[/COLOR]
?> Waat heb ik de fout gemaakt? A.u.b ook zeggen waar !

