Current Path : /home/c247essa/public_html/

Linux 3.12.18-clouder0 #1 SMP Tue Oct 9 18:14:47 EEST 2018 x86_64

Upload File :
Current File : /home/c247essa/public_html/forgot.php
include 'backend.php';
/******************* ACTIVATION BY FORM**************************/
if ($_POST['doReset']=='Reset')
$err = array();
$msg = array();

foreach($_POST as $key => $value) {
	$data[$key] = filter($value);
if(!isEmail($data['user_email'])) {
$err[] = "ERROR - Please enter a valid email"; 
$user_email = $data['user_email'];

//check if activ code and user is valid as precaution
$rs_check = mysql_query("select id from mu_members where email='$user_email'") or die (mysql_error()); 
$num = mysql_num_rows($rs_check);
  // Match row found with more than 1 results  - the user is authenticated. 
    if ( $num <= 0 ) { 
	$err[] = "Error - Sorry no such account exists or registered.";
	//header("Location: forgot.php?msg=$err");

if(empty($err)) {
$new_pwd = GenPwd();
$pwd_reset = PwdHash($new_pwd);
//$sha1_new = sha1($new);	
//set update sha1 of new password + salt
$rs_activ = mysql_query("update mu_members set accpass='$pwd_reset' WHERE 
						 email='$user_email'") or die(mysql_error());
$host  = $_SERVER['HTTP_HOST'];
$host_upper = strtoupper($host);						 
//send email

$message = 
You recently requested for a password change! \n
Here are your new password details ...\n
Username: $user_email \n
Passwd: $new_pwd \n
You can change your password at 'My Profile' Section once logged in.\n
You may log in here\n

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: info <>' . "\r\n";
	//mail($user_email, "Reset Password", $message,
    //"From: \"".SITE_NAME."\" <$site_email>\r\n" .
     //"X-Mailer: PHP/" . phpversion());						 
	// $retval= mail ($user_email,"reset Password",$message,$headers);	
	  //if( $retval == true )
     // echo "Message sent successfully...";
     // echo "Message could not be sent...";
   //}	-->
$fn="Fisrt Name";
$ln="Last Name";
$name=$fn.' '.$ln;
$subject = "Reset Password";
$message = $message;
$msg[] = "Your account password has been reset. <br><br> Kindly check your email address for more details.";						 						 
<title>Forgot Password</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/javascript" src="j_s/jquery-1.3.2.min.js"></script>
<script language="JavaScript" type="text/javascript" src="j_s/jquery.validate.js"></script>
<link href="order_styles/styles.css" rel="stylesheet" type="text/css">
<?php include ROOT_DIR. 'inc/header.php' ;?>
<div id="main-content">
<table width="570" align="center" border="0"  style="padding-top:50px;">
    <td width="100%" valign="top">
<h3 align="center" class="titlehdr">Forgot Password?</h3>

      <p align="center"><span class="style4"></span>Well, it happens. Enter your email and hit 'reset'.<br> Further details will be emailed to you.
      <form action="forgot.php" method="post" name="actForm" id="actForm" >
        <table width="100%" border="0" align="center"  class="login" style="padding-top:20px;">
            <td colspan="2">
	if(!empty($err))  {
	   echo "<div class=\"error\">";
	  foreach ($err as $e) {
	    echo "* $e <br>";
	  echo "</div>";	
	   if(!empty($msg))  {
	    echo "<div class=\"msg_l\">" . $msg[0] . "</div>";

	  /******************************* END ********************************/	  
            <td width="19%">Your Email</td>
            <td width="81%"><input name="user_email" type="text" class="required email" id="user_email" size="25"></td>
            <td colspan="2"> <div align="right"> 
                  <input name="doReset" type="submit" class="input_submit" id="doLogin3" value="Reset">
<?php include ROOT_DIR. 'inc/footer.php' ;?>