include("../inc/config.inc.php"); include("../inc/db_connect.inc.php"); session_start(); $auth_id = 0 + $_SESSION['auth_id']; $href = 0 + $_REQUEST['href']; if ($auth_id > 0) { header("Location: http://fn.ua/articlesinc/read_comments.php?r=" . $href . ""); } $go_auth = $_POST['go_auth']; $uemail = $_POST['uemail']; $upass = $_POST['upass']; if ($go_auth <> '') { // do auth $upassmd5 = md5($upass); $sql = "select uid, uemail, upass from fn_users where uemail='" . mysql_real_escape_string($uemail) . "' and upass='" . $upassmd5 . "'"; $res = mysql_query($sql); $udata = mysql_fetch_object($res); if ($udata->uid <= 0) { $auth_error = true; } else { $_SESSION['auth_id'] = $udata->uid; $_SESSION['uemail'] = $udata->uemail; header('location: auth.php?href=' . $href . ''); } } ?>