Jump to content


Photo

*SOLVED* can anyone help


  • Please log in to reply
2 replies to this topic

#1 the apprentice webmaster

the apprentice webmaster
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 31 March 2006 - 08:38 AM

guys this is my lostpasword script and bpo is the folder root

when i run the script i got this message : 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

here 's the script :

<?php

include $_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;
}
?>


#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 31 March 2006 - 08:48 AM

change:
"at http://".
"$_SERVER['SERVER_NAME']".
to:
at http://" . $_SERVER['SERVER_NAME'] .


#3 the apprentice webmaster

the apprentice webmaster
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 31 March 2006 - 09:03 AM

[!--quoteo(post=360291:date=Mar 31 2006, 03:48 AM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Mar 31 2006, 03:48 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
change:
"at http://".
"$_SERVER['SERVER_NAME']".
to:
at http://" . $_SERVER['SERVER_NAME'] .
[/quote]

thx Wildteen88 , it work thx alot




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users