Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.