Source Code : login.html
<HTML>
<form action="LoginAction.php" method="post" name="loginform">

<!--
- Text box -> User Name : txtuser
- Text box -> Password : txtpwd
-->
</form>
</HTML>
<SCRIPT>
loginform.txtuser.focus();
</SCRIPT>
Create PHP file :
Source code : LoginAction.php
<?phprequire("connect_db.inc");
Download
require("user.inc");
?>
PHP Connect with Database
Source Code : connect_db.inc
<?php
$con=mysql_connect("localhost","root","123")
or die("Could not connect!");
$select=mysql_select_db("dbinfo") or
die("Could not select!");
function exec_query($query){
$result=mysql_query($query) or
die("Could not query!:$query");
return $result;
}
?>
PHP Function User Exit (Select)
Source Code : user.inc
<?phpfunction UserExist($txtuser,$txtpwd){
$query = "select * from tuser where
username='$txtuser' and password='$txtpwd'";
$result = exec_query($query);
$line = mysql_fetch_array($result);
return $line;
}
?>Finish......!