didnt work heres my full page code:
NOTE myserver = the ip address to my webserver.
CODE:
<HTML>
<HEAD>
<TITLE>Protocol Login</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=">
</HEAD>
<form method="post" action="login.php">
<p>
<input type="text" name="username_form">
<font face="Arial, Helvetica, sans-serif"><b>Enter your username</b></font></p>
<p>
<input type="password" name="pw_form">
<font face="Arial, Helvetica, sans-serif"><b>Enter your password</b></font><b><font face="Verdana, Arial, Helvetica, sans-serif">
</font></b></p>
<p> </p>
<p>
<input type="submit" name="Submit" value="Login">
</p>
</form>
<?
if($_POST['Submit'] == 'Login')
{
//CONNECTION TO PROTOCOL DATABASE:
mysql_connect("localhost", "root")
or die("Could not connect:" . mysql_error());
mysql_select_db("prot") or die("connection failed");
$username = $POST['username_form'];
$password = $POST['pw_form'];
$access_numq = mysql_query("SELECT is_admin FROM identity WHERE identity.username = '$username'");
$thepwq = mysql_query("SELECT password FROM identity WHERE identity.username = '$username'");
$theuserq = mysql_query("SELECT username FROM identity WHERE identity.username = '$username'");
$row = mysql_fetch_array($access_numq);
$access_num = $row['is_admin'];
$row2 = mysql_fetch_array($thepwq);
$thepw = $row2['password'];
$row3 = mysql_fetch_array($theuserq);
$theuser = $row3['username'];
if($access_num == 1 && $thepw == $password && $theuser == $username)
{
//FULL ACCESS
//header("Location: [url]http://Intranet/Protocol/interface.php[/url]");
<A HREF="http://intranet/Protocol/interface.php">Protocol Tracking System</A>
</a></p>';
}
if($access_num == 0 && $thepw == $password && $theuser == $username && $username != '')
{
//LIMITED ACCESS
</a></p>';
}
if($thepw != $password || $theuser != $username)
{
echo "incorrect username or password";
}
//CLOSE DATABASE
mysql_close();
}
?>
<p> </p></BODY>
</HTML>