include ("includes/config.php"); global $errmsg; if(isset($_SESSION['user_name'])!='') { header('Location: index.php'); } ?> if(isset($_REQUEST['hdn'])==1) { $q1="Select * from tbl_users where user_name='".$_REQUEST['com_user']."' and user_password='".$_REQUEST['com_pass']."'"; //echo $q1; $rs=mysql_query($q1); //echo $rs; if ($row=mysql_fetch_assoc($rs)) { $_SESSION['user_name'] = $row["user_name"]; header("location:index.php"); } $errmsg = "Invalid Username or Password."; } ?>