Jump to content

*SOLVED* can anyone help


Recommended Posts

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]<?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;
}
?>[/code]
Link to comment
Share on other sites

[!--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
Link to comment
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.