Location: PHPKode > projects > PHP Enter > www/signin.php
<?php @session_start();
include('admin/config.php');
include('admin/options.php');
require_once('./languages/lang_'.$config['lang'].'.php');
$title = $config['title'];
$temp = $config['temp'];
$path = $config['path'];
$ccuser = $_POST['username'];
$ccpass = $_POST['password'];
$ccuser = addslashes($ccuser);
$ccpass = addslashes($ccpass);
$name=array($ccuser,$ccpass);
require_once('recaptchalib.php');
$privatekey = $config['keycaptcha'];
$resp = recaptcha_check_answer ($privatekey,
                                $_SERVER["REMOTE_ADDR"],
                                $_POST["recaptcha_challenge_field"],
                                $_POST["recaptcha_response_field"]);
if (!$resp->is_valid) { 
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." . 
 "(reCAPTCHA said: " . $resp->error . ")");
 }
@$return = $_POST['return'];
foreach ($name as $name) 
{
if(preg_match('#[^A-Za-z0-9-]#', $name)) { echo "Illegal Characters"; Die();
}
if (strlen($name) < 4) {
echo "<center><div id=\"toprow\">The field must be at least 4 characters long.";    
 Die();
}}
$ccpass = md5($_POST['password']);
$query="SELECT * FROM users WHERE username = '" . mysql_real_escape_string($ccuser) ."' and password = '" . mysql_real_escape_string($ccpass) ."'";
$result=mysql_query($query);
if(mysql_num_rows($result) == 0) {
include ('form.php');
exit();
}else {
$sesrow = mysql_fetch_assoc($result);
if($sesrow['active'] == 0){
echo"Your account is not confirmed, check your e-mail for confirmation link!";
exit();
}
@session_regenerate_id();
$_SESSION['INC_USER_ID'] = $sesrow['usid'];
$_SESSION['INC_USER_NAME'] = $sesrow['username'];
$_SESSION['INC_USER_THUMB'] = $sesrow['thumbs'];
session_write_close();
?>
<head>
<?php
if(@$return==true){
$link="news.php?name=" . $return;
$itext="Thank You. You will be redirected to the previous page.";
}else{
$link="link.php";
$itext="Thank You. You will be redirected to the homepage.";
}
?>
<script type="text/javascript">
<!--
function delayer(){
    window.location = "<?php echo $link ?>"
}
//-->
</script>
</head>
<body onLoad="setTimeout('delayer()', 2000)">
<center><b><font style="font-family:verdana;font-size:13px;color:#555;"><?php echo $itext ?></b></font></center>
<?php exit(); } ?>
Return current item: PHP Enter