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/forgot1.php
include 'client_config.php';
include 'session.php';
if (isset($_SESSION['id']) ) {
header("Location: orders/index.php");

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

Kind Regards <br><br>
Sherry Robbert <br>
Support Staff <br> <br>
Email: '.$site_email.'<br>
US: +1(347) 853-7417 <br>
US: +1(347) 443-8922 <br>

	//mail($user_email, "Reset Password", $message,
    //"From: \"".SITE_NAME."\" <$site_email>\r\n" .
     //"X-Mailer: PHP/" . phpversion());						 
//$msg[] = "Your account password has been reset. <br><br> Kindly check your email address for more details.";						 						 
//$msg = urlencode();
//header("Location: forgot.php?msg=$msg");						 

$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.";	
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<html lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Reset Password - <?php echo SITE_HOST_NAME ;?></title>
<?php include  ROOT_DIR_C. 'css_n_files.php' ; ?>  
<link href="order_styles/styles.css" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
<link rel="icon" href="images/favicon.ico" type="image/x-icon">
<script type="text/javascript" src="j_s/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="j_s/jquery.validate.js"></script>
<?php include ROOT_DIR_C.  'inc/header_i.php'; ?>
<div id="main_content_i">
 <div id="sign_in">
<table align="center" border="0"  style="padding-top:50px; margin:0px auto; width:600px;">
    <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=\"ord_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="40"> </td>
            <td colspan="2"> <div align="right"> 
                  <input name="doReset" type="submit"  class="order_submit" id="doLogin3" value="Reset">

<?php  include ROOT_DIR_C. 'inc/footer_i.php'  ?>