note 110913 deleted from function.session-regenerate-id by aharvey
| From: | aharvey@php.net | Date: | Sat, 22 Dec 2012 05:18:50 +0000 |
| Subject: | note 110913 deleted from function.session-regenerate-id by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-192645@lists.php.net to get a copy of this message | ||
Note Submitter: roadpillar at yahoo dot com
----
<?php
session_start();
session_regenerate_id(true);
?>
<html>
<head>
<title>Login...</title>
<?php
include 'db_connect.php';
$result="";
if (isset($_POST['Submit']))
{
$username = $_POST['username'];
$password = $_POST['password'];
$result = mysql_query("Select * From login where user_name='$username'",$link);
$count=mysql_num_rows($result);
if ($count==0)
{
$msg="Username Does Not Exists...";
}
else
{
while($row = mysql_fetch_array($result, MYSQL_BOTH))
{
$usr_pwd=$row['user_password'];
$type=$row['user_type'];
if($usr_pwd!=$password )
{
$msg="Incorrect Password...";
}
else
{
if($type=='Customer')
{
$_SESSION['username']=$_POST['username'];
include "cust_data.php";
exit(0);
}
else if($type=='Teller')
{
$_SESSION['username']=$_POST['username'];
include "teller_data.php";
exit(0);
}
else
{
$_SESSION['username']="Administrator";
include "admin_data.php";
exit(0);
}
}
}
}
}
?>