i get username and password from user in login.php to compare with mysql db username and password.here 2 type of user are admin,user,if login a admin go to uregister.php then login the user go to userlink.php
in the databse 3 fields username,password and usertype.
<html>
<head>
<head>
<body>
<form method=post action="login.php">
<table border=1>
<tr>
<td>
UserName</td><td><input type="text" name="name">
</td>
</tr>
<tr>
<td>
Password</td><td><input type="password" name="apass">
</td>
</tr>
<tr>
<td>
</td><td><input type="Submit" name="check" Value="Submit">
</td>
</tr>
</table>
</form>
</body>
</html>
<?php
$name=$_REQUEST['name'];
$pass2=$_REQUEST['apass'];
echo $name;
echo $pass2;
$no=0;
$no1=1;
$host="localhost";
$user="";
$pass="";
$dbid="upload";
$link=mysql_connect($host,$user,$pass);
mysql_select_db($dbid);
$result=mysql_query("select * from login");
while($row=mysql_fetch_array($result))
{
$username=$row['username'];
$pass1=$row['password'];
$type=$row['usertype'];
}
if($username='$name' && $pass1='$pass2' && $type='$no')
{
print "<script>";
print "window.location='http://www.cdsemployment.com/fileload/uregister.php'";
print "</script>";
}
if($username='$name' && $pass1='$pass2' && $type=$no1)
{
print "<script>";
print "window.location='http://www.cdsemployment.com/fileload/userlink.php'";
print "</script>";
}
mysql_close($link);
?>