Location: PHPKode > projects > PHP Enter > www/reset.php
<?php  session_start();
if(@$_SESSION['INC_USER_ID'] == true){ echo"Error. Signin User";die();}
include('settings.php');
require_once('./languages/lang_'.$config['lang'].'.php');
?>
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8" />
<link type="text/css" href="templates/default/style.css" rel="stylesheet" />
<script language="JavaScript">
function validationEmail(maForm) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(maForm.email.value)){
return (true)
}
alert("Invalid E-mail Address! Please re-enter.")
return (false)
}
</script>
<title><?php echo $title ?> - Password Recovery</title>
</head>
<?php
$id = $_GET['id'];
if($id == false){
echo"<center>Error 404.</center></div>";
die();
}
$query = "SELECT * FROM users where `tempass`  = '" . mysql_real_escape_string($id) . "'";
$results = mysql_query($query);
$numResults = mysql_num_rows($results);
if ($numResults > 0) {
while ($ccrow = mysql_fetch_assoc($results))
{
$usid = $ccrow['usid'];
$username = $ccrow['username'];
$password = $ccrow['password'];
$email = $ccrow['email'];
}
} else {
echo"<center>Error 404</center></div>";
die;
}
if (!isset($_SESSION["jumpsy"]))
$_SESSION["jumpsy"] = 0;
$_SESSION["jumpsy"] = $_SESSION["jumpsy"] + 1;
if ($_SESSION["jumpsy"] > 1)
{
echo"404 Page";
die;
}
$tips = 'JvKnrQWPsThuJteNQAuH';
$cchash = sha1(uniqid($tips . mt_rand(), true));
$cchash = substr($cchash, 0, 8);
$hashe = md5($cchash);
$result = mysql_query("UPDATE users SET password = '" . mysql_real_escape_string($hashe) . "' WHERE usid = '" . mysql_real_escape_string($usid) . "'");	
$urlh = getenv('HTTP_HOST');
$urls = dirname($_SERVER['PHP_SELF']);
$myurl = "http://$urlh$urls" . "link.php";
$body ='
<html>
<head>
<style>
<!--
body, P.msoNormal, LI.msoNormal
{
background-position: top;
background-color: #ffffff;
margin-left:  2em;
margin-top: 1em;
font-family: verdana;
font-size:   10pt;
font-weight:normal;
color:   #555555;
lettet-spacing:1px;
}
h4{
font-weight:normal;
border-bottom:1px solid #A2BBCC;
}
</style>
</head>
<body> 
';
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
$headers .= "From: $ccmail" . "\r\n";
$bodys = "
<head>
<style>
#content{
align:center;
padding:5px;
margin:0px auto;
background:#fff;
border-top:2px solid #FF8300;
width:100%;
font-family;tahoma;
color:#222;
}
</style>
</head>
<div id = 'content'>
<h4>$title</h4>$lang[RETHEADE] \"$username\",<br />$lang[RETNEWP]<br /><br />
<font color=\"#000000\">$cchash</font>
<br /><br /><a href=\"$myurl\">$myurl</a><br /><br />
$lang[RETREGAR], $title $lang[RETTEAM]";
$subject = "$lang[RETSUBJ] $title";
mail($email, $subject, $bodys, $headers);
echo"<div style=\"padding:5px;color:#fff\" id=\"ercont\"><center>$lang[RETSEND]</center></div>";
?>
Return current item: PHP Enter