Ciao ho bisogno di aiuto credo di aver fatto casino e che questo codice php non sia in ordine per far cambiare password agli utenti del sito del mio amico, qualcuno può aiutarmi? e
grazie!!!Ora vorrei mettere questo e non l'altro, l'altro topic ancora senza risposte,
potete anche cancellarlo!!!Ecco il codice!!! Cmq todo credo sia nome del database che il mio è dbc!!!
$todo=$_POST['todo'];
$password=$_POST['password'];
$password2=$_POST['password2'];
if(isset($todo) and $todo=="change-password"){
$password=mysql_real_escape_string($password);
$status = "OK";
$msg="";
if ( strlen($password) < 3 or strlen($password) > 8 ){
$msg=$msg."Password must be more than 3 char legth and maximum 8 char lenght
";
$status= "NOTOK";}
if ( $password <> $password2 ){
$msg=$msg."Both passwords are not matching
";
$status= "NOTOK";}
if($status<>"OK"){
echo "<font face='Verdana' size='2' color=red>$msg</font>
<center><input type='button' value='Retry' onClick='history.go(-1)'></center>";
}else{ // if all validations are passed.
if(mysql_query("update plus_signup set password='$password' where userid='$session[userid]'")){
echo "<font face='Verdana' size='2' ><center>Thanks
Your password changed successfully. Please keep changing your password for better security</font></center>";
}
}