Jump to content

Parse Error


djw821

Recommended Posts

I keep getting a parse error on this section of code but I can't seem to find it.  I was hoping someone could see something I missed.

 

Thanks

 

//Create a new random password

$p = substr( md5(uniqid(rand(),1)), 3, 10);

$query = "UPDATE registration SET password=PASSWORD('$p') WHERE user_id = $uid";

$result = @mysql_query ($query);

if(mysql_affected_rows()==1)

Link to comment
https://forums.phpfreaks.com/topic/98206-parse-error/
Share on other sites

The Exact Error message I am getting is this

 

Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in C:\xampp\htdocs\forgot password.php on line 71

 

Entire section of code is this I have put an ** on line 71.

 

 

if($un){

 

//Create a new random password

$p = substr( md5(uniqid(rand(),1)), 3, 10);

** $query = "UPDATE registration SET password=PASSWORD('$p') WHERE user_id = $uid";

$result = @mysql_query ($query);

if(mysql_affected_rows()==1) {

 

//Send Email

 

$body = "Your password has been temporarily changed to '$p'Please log in using this password and your username.  At that time you may change your password to something you can remember.";

mail($email, Your Temporary Password. ', $body 'From: admin@');

echo'<h3>Your password has been changed you will receive a new, temporary password at the email address you provided when you registered. Once you logged in with this password, you may change it by clicking the "Change Password" link.</h3>';

exit();

 

}else{

 

//Send message to error log

 

$message = '<p><font color="yellow" size="+1">Your password could not be changed due to a system error.  We apologize for any inconvenience.</font></p>';

 

}

mysql_close();

 

}else{

echo '<p><font color="yellow" size = "+1">Please try again</font></p>';

 

}

}

?>

Link to comment
https://forums.phpfreaks.com/topic/98206-parse-error/#findComment-502533
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.