Jump to content

Archived

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

the apprentice webmaster

*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]

Share this post


Link to post
Share on other sites
change:
[code]"at http://".
"$_SERVER['SERVER_NAME']".[/code]to:
[code]at http://" . $_SERVER['SERVER_NAME'] . [/code]

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

×

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.