PHP and JavaScript code used in "Login" section
Posted On at by milanPHP and JavaScript code used in "Login" section
4. Login
The status was:
Enter your login details you added on the previous page and
test the login.
The success or failure will be shown above.
Click here to view the PHP and JavaScript code
used for this page.
// version 1.1
if (isset($password)) // if a the password is set then the form has been submitted on login.php page
{
include("connect2db.php");
$username = $HTTP_POST_VARS['username'];
$password = $HTTP_POST_VARS['password'];
$qstr = "SELECT * from members where username ='$username' and password ='$password'";
$result = mysql_query($qstr);
// check login info is correct
if (mysql_num_rows($result)) echo "
else echo "
mysql_close();
}
else echo "
?>