<?php
$password = htmlspecialchars($_POST['password']);
$username = htmlspecialchars($_POST['username']);
if(isset($_POST['send']) && $username == true && $password == true)
{
$user = preg_match("/lior|aviv|natan|matan|michael|simon/", $username);
$pass = preg_match("/lior|aviv|natan|matan|michael|simon/", $password);
if($user == true && $pass == true) {
header('location: index.php');
# set cookies/sessions ..
} else { // if the deatils is false
print "פרטים שגויים. לחץ F5 ונסה שוב בבקשה.";
}
} else {
print '
<form action="" method="post">
<input type="text" name="username" value="שם משתמש" />
<br />
<input type="password" name="password" value="סיסמה" />
<br />
<input type="submit" name="send" value="התחבר" />
</form>
';
}
?>