login check in php



  // For shot icon on tab//




include("config.php"); //connection file
include("lock.php"); //session check file
//include("logout.php");

if($_SERVER["REQUEST_METHOD"] == "POST")
{
// username and password sent from Form
$myemail=addslashes($_POST['email']);
$mypassword=addslashes($_POST['password']);

$sql="SELECT id FROM userdetails WHERE email='$myemail' and password='$mypassword'";

$result=mysql_query($sql);
$count=mysql_num_rows($result);
$row=mysql_fetch_array($result);
$active=$row['active'];



// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1)
{
session_register("myemail");
$_SESSION['login_user']=$myemail;

header("location:../home.php");
}
else
{
?>


}
}


?>
   

     

Email Id :
       
       
     


     

Password :
       
     


     
     


       
        Remember me on this computer


     

       
     
   

   
 



0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by NDR Group | Bloggerized by Er. Nelson Desai | Love U My Friends