Jump to content

Forgot Password Page is not working...


Teamposse

Recommended Posts

I paid someone to develop my site and for some reason the Forgot Password page is not working.  Once the user types in their email address and submits, nothing happens.  The user should get a message displayed instantly letting them know if the password was sent or if their account was not found.

 

Any help would be greatly appreciated!

 

[code=php:0]
<?
   include_once "connect.php";
   if(isset($_SESSION['RES_LoginID']) && $_SESSION['RES_LoginID']!="")
   {
      echo "<script>window.location='myprofile.php';</script>";
      exit;
   }
   
   // code to send mail to user (account details)
   if(isset($_REQUEST["btnLogin"]))
   {
      $sel="select name,email,password from users where email='".$_REQUEST['RES_EMAIL']."'";
      $urs=mysql_query($sel);
      if (mysql_affected_rows()>0) // send mail if mail existing in database
      {
         $row=mysql_fetch_array($urs);
         $name=$row['name'];
         $username=$row['email'];
         $password=$row['password'];

         $message="<link href='".WEBSITEURL."site.css' rel='stylesheet' type='text/css' />
            <body>
            <table border=0 cellspacing='5' cellpadding=0 width=600 align='center' class='purple_11'>
            <tr><td>
               $SITE_LOGO<br><br>
               Dear <b>".$name."</b>,<br><br>
               
               Your login details are: <br>
               Username : $username<br>
               Password : $password<br>
               <br><br>
               Login at: <a href='".WEBSITEURL."login.php' target='_blank'>$SITE_NAME</a><br><br><br>
               Thank You,<br>
               $SITE_NAME
            </td></tr></table>
            </body>";
   
         $sub="Forgot Password?";
         
         SendHTMLMail($username,$sub,$message,ADMIN_MAIL);

         $redirect="<script>window.location='forgot_password.php?msgs=1';</script>";
      }   
      else // if mail doesnot match
      {
           $redirect="<script>window.location='forgot_password.php?msgs=2';</script>";
      }
      echo $redirect;
      exit;
   }
   
   // generate message for display
   $msg="";
   if(isset($_REQUEST['msgs']))
   {
      switch($_REQUEST['msgs'])
      {
         case 1 :   $msg="Your password sent successfully.";
                  break;
         case 2 :   $msg="Email Address does not exists.";
                  break;
      }
   }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url=http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/url]">
<html xmlns="[url=http://www.w3.org/1999/xhtml]http://www.w3.org/1999/xhtml[/url]">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="<?=$KEYWORD?>" />
<link rel="shortcut icon" href="images/favicon.gif">
<title><?=$SITE_TITLE?></title>
<link href="site.css" rel="stylesheet" type="text/css" />
<script language="javascript">
function valid_login()
{
   form=document.frmLogin;
   if(form.RES_EMAIL.value=="")
   {
      alert("Please enter your email.")
      form.RES_EMAIL.focus();
      return false;
   }
   else if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(form.RES_EMAIL.value)))
   {
         alert("Please enter a proper email address.");
         form.RES_EMAIL.focus();
         return false;
   }   
   else
   {
      form.submit();
   }    
}
</script>
</head>

<body onload="MM_preloadImages('images/about-us-hover.jpg','images/my-pofile-hover.jpg','images/help-hover.jpg','images/home.jpg')">
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1251" align="center" valign="top" class="main_bg"><table width="850" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="153" align="left" valign="top"><? include_once "top.php"; ?></td>
      </tr>
      <tr>
        <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="18"></td>
            </tr>
            <tr>
              <td><table width="822" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="11" align="left" valign="top"><img src="images/white-crv1.jpg" width="11" height="11" /></td>
                    <td width="100%" height="11" class="gray-top-bdr"><img src="images/blank-img.gif" width="1" height="1" /></td>
                    <td width="11" align="right" valign="top"><img src="images/white-crv2.jpg" width="11" height="11" /></td>
                  </tr>
                  <tr>
                    <td width="11" class="gray-left-bdr"><span class="gray-top-bdr"><img src="images/blank-img.gif" width="1" height="1" /></span></td>
                    <td align="center"><?   include("gad_hori.php");?></td>
                    <td width="11"class="gray-rightt-bdr"><span class="gray-top-bdr"><img src="images/blank-img.gif" width="1" height="1" /></span></td>
                  </tr>
                  <tr>
                    <td width="11" height="11" align="left" valign="bottom"><img src="images/white-crv3.jpg" width="11" height="11" /></td>
                    <td height="11" class="gray-bot-bdr"><img src="images/blank-img.gif" width="1" height="1" /></td>
                    <td width="11" height="11" align="left" valign="bottom"><img src="images/white-crv4.jpg" width="11" height="11" /></td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td height="73" align="left" valign="top"></td>
            </tr>
            <tr>
              <td align="left" valign="top"><table width="822" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="587" align="left" valign="top"><table width="587" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="19"><img src="images/gray-left-crv.jpg" width="19" height="247" /></td>
                      <td width="321" align="left" valign="top" class="gry-bg-rpt">
                 <form name="frmLogin" id="frmLogin" action="" method="post">
                 <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td height="20"></td>
                        </tr>
                        <tr>
                          <td height="27" class="gray-bot-bdr red-txt20" valign="top">Forgot Password?</td>
                        </tr>
                        <tr>
                          <td height="25" align="center" valign="middle" class="red-txt12"><?=$msg;?></td>
                        </tr>
                        <tr>
                          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td colspan="2" height="22" align="left" style="padding-left:15px;"><strong>Please enter your E-mail address to get the password .</strong></td>
                            </tr>
                            <tr height="15"><td> </td></tr>
                            <tr>
                              <td width="33%" align="center"><strong>Email Address :</strong></td>
                              <td width="67%"><input name="RES_EMAIL" type="text" class="input"  style="width:176px; height:20px;"/></td>
                            </tr>

                            <tr>
                              <td> </td>
                              <td height="40" align="center">
                          <input type="submit" name="btnLogin" value="" class="btn_submit" title="Sign In" onclick="return valid_login();" />
                       </td>
                            </tr>
                            <tr>
                              <td> </td>
                              <td height="25" align="left" valign="bottom">Know your password? <a href="login.php">Login here</a></td>
                            </tr>
                          </table></td>
                        </tr>
                      </table>
                 </form>
                 </td>
                      <td width="247" align="left" valign="top" class="red-box2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td height="88"> </td>
                          <td> </td>
                        </tr>
                        <tr>
                          <td width="77"> </td>
                          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td height="85" align="left" valign="top"><img src="images/dont-acc.jpg" width="135" height="65" hspace="10" /></td>
                            </tr>
                            <tr>
                              <td height="40" align="left" valign="top"><a href="register.php"><img src="images/register-but.jpg" alt="Register Here" width="146" height="30" border="0" /></a></td>
                            </tr>
                          </table></td>
                        </tr>
                      </table></td>
                    </tr>
                  </table></td>
                  <td width="235" align="right" valign="top"><?   include("square_ads.php");?></td>
                </tr>
              </table></td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td valign="top"><? include_once "bottom.php"; ?></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>

[/code]

Link to comment
Share on other sites

I had actually already edited your post. When using code tags, the syntax highlighting doesn't work with short <? open tags, so I had used

 . . . 

tags to force syntax highlighting.

 

At any rate, is there a call to session_start() in the connect.php file? If not, it should be added to the above file immediately after the opening <?php tag.

Link to comment
Share on other sites

Thanks and my apologies for being a novice!

 

Here is the code for the Connect.php:

 

<?php
session_start();
include ("include/config.inc.php");
include ("include/functions.php");
include ("include/sendmail.php");

   $db=mysql_connect($DBSERVER, $USERNAME, $PASSWORD);
   mysql_select_db($DATABASENAME,$db);
   $SITE_TITLE = "Welcome to Resumeposse.com";
   $SITE_URL = "http://resumeposse.com/";

$KEYWORD = "Resume, Free Resume, Resume Help, Job, Jobs, Write a Resume, Resume Writer, Resume Posting, Post Resume, Complete Resume, Vote Resume, Sample Resume, Resume Advice";
$KEYWORD .= ",CV ,Free CV, CV Help, Write a CV, CV Writer, CV Posting, Post CV, Complete CV, Vote CV, Sample CV, CV Advice";
?>

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.