😉
Hi all,
i'm trying to check a username and a password via a form textfield. When username and password is correct then it should go to the desired page. Everything works fine, except the calling of the desired page...
Here is the snippet:
Thanx in advance Olli
<?
if($user == $usern && $pass == $passw)
{
$go = "www.someurl.com";
}
?>
<form name="password_check" method="post" action="<?echo $go;?>">
$reader = "pass.txt";
$fp = file($reader);
for($i=0; $i<count($fp); $i++)
{
$usern = trim($fp[0]);
$passw = trim($fp[1]);
}
if(isset($submit))
{
if($user == $usern && $pass == $passw)
{
print "<font color=green size=4><b>Access granted</b></font>";
}
elseif(empty($user) && empty($pass))
{
print"";
}
elseif(empty($user))
{
print "<font color=red size=3><b>Enter Username</b></font>";
}
elseif(empty($pass))
{
print "<font color=red size=3><b>Enter your Password</b></font>";
}
elseif($user != $usern)
{
print "<font color=red size=3><b>Username incorrect !</b></font>";
}
elseif($pass != $passw)
{
print "<font color=red size=3><b>Password incorrect !</b></font>";
}
}
?>
</form>