Hello,
can some body help me in modifying my code little bit.
I'm trying to put up a log-in screen, the user name and password is hardcode.If the user does'nt enter the login details and press submit, it should check for error 1 and if the login details are not correct it should check for error 2.
Hope somebody would help me.
thank you
<?php
session_start();
?>
<?php
$myuser = "admin";
$mypass = "pass";
if ($user == $myuser && $pass == $mypass)
{
header ('location: main.php');
}
else
{
echo"<form action=\"$PHP_SELF\" method=\"POST\">\n";
}
?>
<?
//To check if no user name and password is entered.
if ($error==1){
echo "<font color=\"#FF0000\" face=\"vendana\" size=\"2\">";
echo "Invalid Login - Please try again";
echo "</font>";
echo "<br>";
session_destroy();
}
//To check if user name and password entered is wrong
if ($error==2){
echo "<font color=\"#FF0000\" face=\"vendana\" size=\"2\">";
echo "Unauthorized Access - Please Login";
echo "</font>";
echo "<br>";
session_destroy();
}
//To set the form for input
?>
Herez my html code which displays the log-in screen.