Jump to content

expire session


mdvignesh

Recommended Posts

ya

 

<?php
session_start();
ob_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Signin</title>
</head>

<?php
include("data.php");
$user_err='';
$pass_err='';
if(isset($_POST['submit']))
{ 
    $user=$_POST['user'];
    $passwd=$_POST['pass'];
    $err=0;
    if($user=="")
     {
          $user_err="enter username";
           $err=1;
       }
       if($passwd=="")
       {
          $pass_err="enter password";
          $err=1;
       }
      if($err==0)
	{
          	 $check=mysql_query("select username from register where username='$user'")or die(mysql_error());
         	 $check2=mysql_num_rows($check);
         	 if($check2==0)
        	 {
        	    $uer="User does not exist,enter correct username";

         	 }
		else
		{
		   $check1=mysql_query("select password from register where username='$user' and password='$passwd'")or die(mysql_error());
		   $check2=mysql_num_rows($check1);
		   if($check2==0)
		    {
				$per="Password mismatch,enter correct password";
			}
			 else
         		{  
			       $_SESSION['user']=$user;
			       $_SESSION['password']=$passwd;
         			   header("location:msg.php");
         		}	
            }
        
   }	
mysql_close($cn); 
}		
?>
<body>
<br /><br />
<form method="post" action="loginpage.php">
<table bgcolor="#6699FF" width="500" height="300" align="center">
<tr><td align="center">
<strong>Sign in with your account</strong><br /><br /><br />


USERNAME:<input type="text" name="user" value="" />
<br /><br />
PASSWORD:<input type="password" name="pass" value=""/> <br/><br/>
<input type="submit" value="login" name="submit" />
</td></tr>
</table>
</form>
</body>
</html>

 

 

Link to comment
https://forums.phpfreaks.com/topic/246036-expire-session/#findComment-1263565
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.