Can anyone help me on how to filter login and turn off autofill?

Here’s my PHP code:

Quote:

<?php
include("../connect.php");
ob_start();
if($_POST["mode"]=="admin")
{
admin_login();
}
else if($_GET["mode"]=="logout")
{
admin_logout();
}
else
{
main();
}
function admin_logout()
{
session_unset();
session_destroy();
$GLOBALS["msg"]="You are logged out";
main();
exit;
}
function main()
{
?>
<script src="config/jquery-latest.js"></script>
<script type="text/javascript" src="config/jquery.validate.js"></script>
<style type="text/css">
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
</style>
<script>
$(document).ready(function(){
$("#form1").validate();
});
</script>
<table width="475" border="0" align="center" cellpadding="0" cellspacing="0" style="border:thin solid #000000;">
<tr>
<td align="center" style="border-bottom:thin solid #000000;"><h2>Welcome To Admin Panel</h2></td>
</tr>
<tr>
<td width="475">
<form id="form1" name="form1" id="form1" class="cmxform" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<input type="hidden" name="mode" value="admin">
<table width="334" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td>&nbsp;</td>
<td><b><?php if(isset($GLOBALS["msg"])) { echo $GLOBALS["msg"]; }?></b></td>
</tr>

<form method="post" action="http://localhost/admin/admin.php">
<tr>
<td><b>Account Type:</td> <td><select name="accttype"></b>
<option value="1">Admin</option>
<option value="2">Team Manager</option>
<option value="3">Human Resources</option>
<option value="4">Employee</option> </td>
</select>
</tr>

</form>
<tr>
<td><b>User Name: </b></td>
<td>
<input type="text" name="username" class="required" />
</td>
</tr>
<tr>
<td><b>Password:</b></td>
<td>
<input type="password" name="password" class="required" />
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" name="login" value="login"/>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<?php
}
function admin_login()
{
$sql="select * from admin where username=’".$_POST[username]."’ and password=’".$_POST[password]."’";

$query=mysql_query($sql);
$row=mysql_fetch_array($query);
$num=mysql_num_rows($query);
if($num==1)
{
$_SESSION["user_id"]=$row["username"];
header("location:admin.php");
exit;
}
else
if($num==2)
{
$_SESSION["user_id"]=$row["username"];
header("location:TM.php");
exit;
}
else
{
$GLOBALS["msg"]="<font color=red>Wrong Username or Password</font>";
main();
exit;
}
}
ob_end_flush();
?>


Question:
1) Why does the autofill from Username and Password doesn’t turn off even if I turn it off on the browser?

2)How do I filter login? (example: when logged choosing the Team Managers from drop down menu, it will go to a certain page)

View full post on Tycoon Talk

, , , , ,

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Get Adobe Flash playerPlugin by wpburn.com wordpress themes


RSS Site FeedRSS Site Feed

© 1992-2011 DC2NET™, Inc. All Rights Reserved