Current File : /home/inlingua/www/sensoriumpsychologists.com/admin/forgetpass.php
<?php
//error_reporting(0);
include('lib/config.php');
extract($_REQUEST);
if(isset($submit))
{	
	$sql="select * FROM tbl_admin 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 tbl_admin SET password='$new_password' where email='$email'");
		// send the password to user mail id
			$to               = $email;
			$from="sushantroy111@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 valide 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>PESTGOGO - Login</title>

	<!-- Bootstrap -->
	<link rel="stylesheet" href="../css/bootstrap.min.css">
	<!-- Bootstrap responsive -->
	<link rel="stylesheet" href="../css/bootstrap-responsive.min.css">
	<!-- icheck -->
	<link rel="stylesheet" href="../css/plugins/icheck/all.css">
	<!-- Theme CSS -->
	<link rel="stylesheet" href="../css/style.css">
	<!-- Color CSS -->
	<link rel="stylesheet" href="../css/themes.css">


	<!-- jQuery -->
	<script src="../js/jquery.min.js"></script>
	
	<!-- Nice Scroll -->
	<script src="../js/plugins/nicescroll/jquery.nicescroll.min.js"></script>
    
	<!-- Validation -->
	<script src="../js/plugins/validation/jquery.validate.min.js"></script>
	<script src="../js/plugins/validation/additional-methods.min.js"></script>
	<!-- icheck -->
	<script src="../js/plugins/icheck/jquery.icheck.min.js"></script>
	<!-- Bootstrap -->
	<script src="../js/bootstrap.min.js"></script>
	<script src="../js/eakroko.js"></script>

	<!--[if lte IE 9]>
		<script src="../js/plugins/placeholder/jquery.placeholder.min.js"></script>
		<script>
			$(document).ready(function() {
				$('input, textarea').placeholder();
			});
		</script>
	<![endif]-->
	

	<!-- Favicon -->
	<link rel="shortcut icon" href="../img/favicon.ico" />
	<!-- Apple devices Homescreen icon -->
	<link rel="apple-touch-icon-precomposed" href="../img/apple-touch-icon-precomposed.png" />

</head>

<body class='login'>
	<div class="wrapper">
		<h1><a href="index.php"><img src="../img/logo-big.png" alt="" class='retina-ready' width="59" height="49">PESTGOGO</a></h1>
		<div class="login-body">
			<h2>Foreget Password</h2>
            <span style="color:#F00; margin-left:30px;"><?php //echo $msg;?></span>
			<form   method="post" class='form-validate' id="login-form">
				<div class="control-group">
					<div class="email controls">
						<input type="text" name='email' placeholder="Email address" class='input-block-level' data-rule-required="true" data-rule-email="true" id="email">
					</div>
				</div>
				
				<div class="submit">
					
					<input type="submit" value="Submit" class='btn btn-primary' id="btn-login" name="submit">
				</div>
			</form>
			<div class="forget">
				<a href="index.php"><span>Home</span></a>
			</div>
		</div>
	</div>
 
</body>

</html>