accessloginform.htm
<html><body bgcolor="#cccfff">
<form action="accessuserlogin.php" method="post">
User Name :<input type="text" name="user"/><br/>
Password :<input type="password" name="pwd"/><br/>
<input type="submit" value="Login" ><input type="reset" value="clear" ><br/>
</form>
</body>
</html>
More PHP & MySQLtutorials --->
Free html templates --->
accessuserlogin.php
<?php$con = odbc_connect (mydata,"admin","nopass");
$query="select name from user where user_id=".$_POST['user']." and passwd='".$_POST['pwd']."'";
$res = odbc_exec($con, $query);
if($row = odbc_fetch_into($res, $cols))
echo "<h1>Welcome ". $cols['name']."</h1>";
else
{
echo "<h1 style='color:red'>Wrong User id or Password</h1>";
echo "<a href='accessloginform.htm'>Try Again</a>";
}
?>
No comments:
Post a Comment
Thanks for visiting my Blog!