Login.php
<!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=iso-8859-1" />
<title>Crime Reporting</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<div id="header">
<img src="images/cits.png" width="959" height="100%" id="header img"/>
</div>
<div id="nav">
<a href="index.php"><b>Home</b></a>
<a href="About.php"><b>About</b></a>
<a href="Contact.php"><b>Contact Us</b></a>
<a href="#"><b>Offices</b></a>
<a href="#"><b>Staffs</b></a>
<a href="#"><b>Criminals</b></a>
<a href="#"><b>Message</b></a>
<input type="text" name="search" />
<input type="button" name="Search" value="Search" />
</div>
<div id="content">
<br />
<form name="Login Page" method="post" action="LoginConfirm.php">
<fieldset>
<table>
<h3 align="center"><img src="images/login_banner.jpg" height="120" width="650" /></h3>
</table></fieldset><br />
<fieldset><legend><img src="images/loginics.gif" height="40" width="50"/> <b>Login Information</b></legend> <br /> <table>
<tr>
<td>User Name:</td>
<td><input type="text" name="txtuname" /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="txtpass" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td><input type="submit" name="submit" value="Login" class="button"/></td>
<td><input type="reset" name="reset" value="Reset" class="button"/></td>
</tr>
</table></fieldset><br />
<tr>
<td><a href="Reg.php"><b>New User !</b></a></td>
<td><a href="#"></a><b>Forgot Password</b></td>
</tr>
</form>
</div>
<br />
<div id="sidebar">
<br />
<fieldset>
<legend><b>Navigation</b></legend><br />
<li><a href="index.php">Home</a></li></br>
<li><a href="About.php">About Us</a></li></br>
<li><a href="Contact.php">Contact Us</a></li></br>
<li><a href="Login.php">Login</a></li></br>
<li><a href="Reg.php">Registration</a></li>
</fieldset>
</div>
<div id="footer">
<p class="color">Copyright @ 2014 <a href="#" class="color 1">Cyber Crime</a></p>
</div>
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Crime Reporting</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<div id="header">
<img src="images/cits.png" width="959" height="100%" id="header img"/>
</div>
<div id="nav">
<a href="index.php"><b>Home</b></a>
<a href="About.php"><b>About</b></a>
<a href="Contact.php"><b>Contact Us</b></a>
<a href="#"><b>Offices</b></a>
<a href="#"><b>Staffs</b></a>
<a href="#"><b>Criminals</b></a>
<a href="#"><b>Message</b></a>
<input type="text" name="search" />
<input type="button" name="Search" value="Search" />
</div>
<div id="content">
<br />
<form name="Login Page" method="post" action="LoginConfirm.php">
<fieldset>
<table>
<h3 align="center"><img src="images/login_banner.jpg" height="120" width="650" /></h3>
</table></fieldset><br />
<fieldset><legend><img src="images/loginics.gif" height="40" width="50"/> <b>Login Information</b></legend> <br /> <table>
<tr>
<td>User Name:</td>
<td><input type="text" name="txtuname" /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="txtpass" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td><input type="submit" name="submit" value="Login" class="button"/></td>
<td><input type="reset" name="reset" value="Reset" class="button"/></td>
</tr>
</table></fieldset><br />
<tr>
<td><a href="Reg.php"><b>New User !</b></a></td>
<td><a href="#"></a><b>Forgot Password</b></td>
</tr>
</form>
</div>
<br />
<div id="sidebar">
<br />
<fieldset>
<legend><b>Navigation</b></legend><br />
<li><a href="index.php">Home</a></li></br>
<li><a href="About.php">About Us</a></li></br>
<li><a href="Contact.php">Contact Us</a></li></br>
<li><a href="Login.php">Login</a></li></br>
<li><a href="Reg.php">Registration</a></li>
</fieldset>
</div>
<div id="footer">
<p class="color">Copyright @ 2014 <a href="#" class="color 1">Cyber Crime</a></p>
</div>
</div>
</body>
</html>
LoginConfirm.php
<?php session_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=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?php
include_once("Connection.php");
$c = new Connectionclass();
$c->connect();
$query = "select * from login_master where uname='".$_REQUEST["txtuname"]."' and password='".$_REQUEST["txtpass"]."'";
$c->calldata($query);
$no=mysql_num_rows($c->res);
if($no > 0)
{
$row = mysql_fetch_array($c->res);
$_SESSION["uname"] = $row[1];
$_SESSION["userid"] = $row[6];
$_SESSION["type"] = $row[3];
if($row[3] == "citizen")
{
echo "<script>document.location='Citizen/';</script>";
}
else if($row[3] == "admin")
{
echo"<script>document.location='Admin/';</script>";
}
else if($row[3] == "OfficeAdmin")
{
echo"<script>document.location='Staff/';</script>";
}
}
else
{
echo"<script>alert('Invalid Data');document.location='Login.php';</script>";
}
?>
</body>
</html>
<!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=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?php
include_once("Connection.php");
$c = new Connectionclass();
$c->connect();
$query = "select * from login_master where uname='".$_REQUEST["txtuname"]."' and password='".$_REQUEST["txtpass"]."'";
$c->calldata($query);
$no=mysql_num_rows($c->res);
if($no > 0)
{
$row = mysql_fetch_array($c->res);
$_SESSION["uname"] = $row[1];
$_SESSION["userid"] = $row[6];
$_SESSION["type"] = $row[3];
if($row[3] == "citizen")
{
echo "<script>document.location='Citizen/';</script>";
}
else if($row[3] == "admin")
{
echo"<script>document.location='Admin/';</script>";
}
else if($row[3] == "OfficeAdmin")
{
echo"<script>document.location='Staff/';</script>";
}
}
else
{
echo"<script>alert('Invalid Data');document.location='Login.php';</script>";
}
?>
</body>
</html>
1 comments:
JCMH | JCMH - JamBase
JCMH is a 구미 출장마사지 new online 의정부 출장샵 casino and 서귀포 출장마사지 game provider 경산 출장안마 from JamBase. Join today and get a 100% match bonus up to $600 at 세종특별자치 출장안마 JCMH!
Post a Comment