Try and use correct indenting, you and Aaron, and if you want to check for a string then do "string"!
I see you do "if ($cond == mental)" or something, but you NEED TO MAKE "mental" a string!
This is correct:
PHP Code:
<?php
$username = $_POST['name'];
$password = $_POST['password'];
if (isset($_POST['submit']))
{
if ($username == "hotelunder")
{
if ($password == "123456")
{
echo "Welcome Hotelunder";
}
else
{
echo "Wrong Password";
}
}
elseif ($username == "mental")
{
if ($password == "123456")
{
echo "Welcome God";
}
else
{
echo "Wrong Password";
}
}
else
{
echo "Welcome Guest";
}
}
else
{
?>
<form method="post" action="<?=$_SERVER['PHP_SELF'];?>">
Name: <input type="text" size="10" maxlength="40" name="name"><br />
Password: <input type="password" size="10" maxlength="10" name="password">
<input name="submit" type="submit" value="Login">
</form>
<?php
}
?>
And, why not try making a tut that uses like FlatFile/INI's, for the people that don't have DB's.