Current File : /home/inlingua/public_html/dwarka/icentex/pg/s_forgetpass.php
<?php
//error_reporting(0);
include('classes/config.php');
extract($_REQUEST);
if(isset($submit))
{	
	$sql="select * FROM shristi_student where email='$email'";
	$result=$conn->query($sql);
	$count=$result->num_rows ;
	if($count!=0){
		//generate new password
		$random=rand(72891,92729);
		$new_password=$random;
		//creat copy or the new password
		$email_password=$new_password;
		//encrypt the new password
		//$new_password=$new_password;
		//update the newpassword
		$conn->query("update shristi_student SET password='$new_password' where email='$email'");
		// send the password to user mail id
			$to               = $email;
			$from="ashish.143.08.ranjan@gmail.com";
		    $headers     = "From:".$from."\r\n";
			$newLine     = "\r\n";
			$headers .= "Reply-To:" .$email. "\r\n";
			$headers .= "MIME-Version: 1.0" . "\r\n";
			$headers .= "Content-Type: text/html; charset=ISO-8859-1" . "\r\n";
		
			$subject="login form information";
			$message="your password has been change to $email_password";
			
			
		if(mail($to,$subject,$message,$headers)){
			echo '<div class="alert alert-info">
                        <a class="close" data-dismiss="alert" href="#">&times;</a>
                         New password send to your mail id;
                    </div>';
		}
		
	}
	else 
		{
			echo '<div class="alert alert-danger">
            <a class="close" data-dismiss="alert" href="#">&times;</a>
                <strong>Error!</strong> Please Enter valid Email id.</div>';
		}
}

?>
<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<!-- Apple devices fullscreen -->
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<!-- Apple devices fullscreen -->
	<meta names="apple-mobile-web-app-status-bar-style" content="black-translucent" />
	
	<title>Forget Password</title>

<?php include("common/head_links.php");?>
	

</head>

<body >
	<div id="box_wrapper">
		 <?php include("common/header.php");?>
		<section id="topOfPage" class="topTabsWrap color_section">
        <div class="container">
            <div class="row">
                <div class="col-sm-12">
                    
                    <h3 class="pageTitle h3">Forget Password</h3>
                </div>
            </div>
        </div>
    </section>
            
            <section class="mainWrap">
        <div class="container">
                  
                    <div class="row">
                    	
                        <div class="col-sm-4">
                        
                        
                        
                        <form method="post">
                          <div class="form-group">
                            <label for="email">Email ID:</label>
                           <input type="text" name='email' placeholder="Email address" class='input-block-level' data-rule-required="true" size="27" data-rule-email="true" id="email"><button type="submit" class="btn btn-success pull-right" name="submit">Submit</button>
                          </div>
                          
                         
                          
                        </form>
                            
                          
                        
                    </div>
                </div>
                </div>

     </section>
            
            
           
			
			
		</div>
        <?php include("common/footer.php");?>
	</div>
 <div class="preloader">
    <div class="preloader_image"></div>
</div>

       <?php include("common/footer_links.php");?>

</body>

</html>