the apprentice webmaster Posted March 31, 2006 Share Posted March 31, 2006 guys this is my lostpasword script and bpo is the folder root when i run the script i got this message : [b]Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\Program Files\xampp\htdocs\bpo\lostpw.php on line 55[/b]here 's the script :[code]<?phpinclude $_SERVER['DOCUMENT_ROOT']. '/bpo/layout.php'; switch($_REQUEST['req']){case "recover": myheader("Reset Password"); $sql = mysql_query("SELECT * FROM members WHERE email_address = '{$_POST['email_address']}' "); if(mysql_num_rows($sql) == 1){ while($row = mysql_fetch_assoc($sql)){ $alphanum = "abchefghjkmnpqrstuvwxyz0123456789"; for ($i=0; $i <= 10; $i++) { $num = rand() % 33; $tmp = substr($alphanum, $num, 1); $newpass = $newpass . $tmp; $i++; } $update = mysql_query("UPDATE members SET password = '".md5($newpass)."' WHERE id='{$row['id']}'"); stripslashes(extract($row)); } if(!$update){ echo '<p align="center">Password Could '. 'not be reset! Sorry!</p>'; } else { echo '<p align="center">Password Reset! '. 'Please check your email for your new '. 'password.</p>'; include $_SERVER['DOCUMENT_ROOT']. '/bpo/html/forms/login_form.html'; // mail user. $mailer = &new Email; $mailer->ToMail = $email_address; $mailer->FromMail = "admin@test.com"; $mailer->FromName = "My PHP Site Administrator"; $mailer->Subject = "New Password For My PHP Site"; $mailer->Message = "Dear $first_name,\n\n". "You have requested a new ". "password for My PHP Site. ". "Below is your new login ". "informaiton:\n\n". "=====================\n". "Username: $username\n". "New Password: $newpass\n". "=====================\n\n". "You may login at any time ". "at http://". "$_SERVER['SERVER_NAME']". "/login.php\n\n". "Thank You!\n". "My PHP Site Administrator"; $mailer->SendMail(); } } else { echo '<p align="center">We could not find '. 'any matches for that email address! '. 'Please try again!</p>'; } footer();break;default: myheader("Reset Password"); include $_SERVER['DOCUMENT_ROOT']. '/bpo/html/forms/lostpw_form.html'; footer();break;}?>[/code] Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted March 31, 2006 Share Posted March 31, 2006 change:[code]"at http://"."$_SERVER['SERVER_NAME']".[/code]to:[code]at http://" . $_SERVER['SERVER_NAME'] . [/code] Quote Link to comment Share on other sites More sharing options...
the apprentice webmaster Posted March 31, 2006 Author Share Posted March 31, 2006 [!--quoteo(post=360291:date=Mar 31 2006, 03:48 AM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Mar 31 2006, 03:48 AM) [snapback]360291[/snapback][/div][div class=\'quotemain\'][!--quotec--]change:[code]"at http://"."$_SERVER['SERVER_NAME']".[/code]to:[code]at http://" . $_SERVER['SERVER_NAME'] . [/code][/quote]thx Wildteen88 , it work thx alot Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.