$value) $$var = mysql_real_escape_string($value); $res = mysql_query("SELECT u_id, u_role, u_mail FROM users, forgot_pass WHERE fp_user = u_id AND SHA1(fp_user) = '$nu' AND fp_key = '$nkdb' AND fp_time > DATE_SUB(CURDATE(), INTERVAL 1 DAY)"); session_start(); if(mysql_num_rows($res)){ $row = mysql_fetch_array($res); $_SESSION['u_id'] = $row['u_id']; $_SESSION['u_role'] = $row['u_role']; $_SESSION['u_mail'] = $row['u_mail']; $_SESSION['expired'] = '0'; header("Location: $lang/new-pass"); }else{ $_SESSION['expired'] = '1'; header("Location: $lang/new-pass"); } } else{ header("Location: $lang/home"); } ?>