Location: PHPKode > projects > EasyFest > new/forgetPassword.php
<?php
	header("Expires: Thu, 17 May 2001 10:17:17 GMT");    // Date in the past
	header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
	header ("Cache-Control: no-cache, must-revalidate");  // HTTP/1.1
	header ("Pragma: no-cache");                          // HTTP/1.0

//.............finalised code......
$title="Forget Password Page";


include_once("include/db_connection.php");
// value sent from form
if( isset( $_POST['email_to'] ) ) 
{
$email_to=$_POST['email_to'];
//echo $email_to;
// table name
$tbl_name='users';

// retrieve password from table where e-mail = $email_to(hide@address.com)
$sql="SELECT Password FROM $tbl_name WHERE EmailId='$email_to'";
echo $sql;
$result=mysql_query($sql);

// if found this e-mail address, row must be 1 row
// keep value in variable name "$count"
$count=mysql_num_rows($result);

// compare if $count =1 row
if($count==1){

$rows=mysql_fetch_array($result);

// keep password in $your_password
$your_password=$rows['Password'];

// ---------------- SEND MAIL FORM ----------------

// send e-mail to ...
$to=$email_to;

// Your subject
$subject="Your password here";

// From
$header="from: hide@address.com";

// Your message
$messages= "Your password for login to our website \r\n";
$messages.="Your password is :$your_password \r\n";
$messages.="more message... \r\n";

// send email
$sentmail = mail($to,$subject,$messages,$header);

}

// else if $count not equal 1
else {
echo "Not found your email in our database";
}

// if your email succesfully sent
if($sentmail){
$msg="Your Password Has Been Sent To Your Email Address.";
}
else {
$msg="Cannot send password to your e-mail address";
}

?>
<script type="text/javascript">
window.location="user_login.php?msg=<?php echo $msg;?>";
</script>


<?php } ?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License

Name       : Premium Series
Description: A three-column, fixed-width blog design.
Version    : 1.0
Released   : 20090303

-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<?php /*doCSS();*/ ?>

<title>Premium Series by Free CSS Templates</title>
<meta name="keywords" content="" />
<meta name="Premium Series" content="" />
<link href="default.css" rel="stylesheet" type="text/css" media="screen" />
    <link type="text/css" href="menu.css" rel="stylesheet" />
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript" src="menu.js"></script>
	<script type="text/javascript" src="ajaxfunction.js"></script>
</head>
<body>
<!-- start header -->
<div id="header">
	<div id="logo">
		<h1><a href="#"><span>Easy</span>Fest</a></h1>
		
	</div>
	<div id="menu">
		<ul class="menu">
        	

		</ul>
	</div>
	
</div>
<!-- end header -->
<div id="wrapper">
	<!-- start page -->
	<div id="page">
		<div id="sidebar1" class="sidebar">
			<ul>
			  <li>
				<h2>Reset Password </h2>
				  <ul>
					  <li>
					    <div class="loginBox">
<form action="<?php print $_SERVER["PHP_SELF"]; ?>" method="POST">
    	
    <table align="center" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; color:#000000;">
      <tr>
        <td>Email ID :</td>
        <td><input type="text" name="email_to" value="" maxlength="45"></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><input name="submit" type="submit" ></td>
      </tr>
    </table>
    </form>
           
  </div>
                    </li>
				  </ul>
				</li>
			</ul>
        </div>
		<!-- start content -->
        <div id="prtCnt" align="center">
          <div id="content" align="center">
			<div class="flower"></div>
			<div class="post">
				<h1 class="title"><a href="#">Welcome to EasyFest</a></h1><div class="entry">
			    <p align="justify"><strong>College festivals have emerged as a booming business opportunity for prominent brands to establish their presence in a predominantly youth driven market. As the magnitude and level of fests increases with each passing year there grows a need for a system that centralizes the various aspects of a fest be it accounts, public relations or hospitality. So here is a one stop solution to all your management needs - EasyFest festival management system. </strong></p>
				</div>
			</div>

		</div>
      </div>
        <!-- end content -->
		<!-- start sidebars -->
		<!-- end sidebars -->
	  <div style="clear: both;">&nbsp;</div>
	</div>
	<!-- end page -->
</div>
<div id="menu">
		<ul class="menu">

		</ul>
	</div>
	
<div id="footer">
	<p class="copyright">&copy;&nbsp;&nbsp;2009 All Rights Reserved &nbsp;&bull;&nbsp; Design by <a href="http://www.freecsstemplates.org/">Apoorv Agrawal</a>.</p>
	<p class="link"><a href="#">Privacy Policy</a>&nbsp;&#8226;&nbsp;<a href="#">Terms of Use</a></p>
    <div id="copyright">Copyright &copy; 2010 <a href="http://apycom.com/">Apycom jQuery Menus</a></div>
</div>
</body>
</html>
Return current item: EasyFest