קוד:
<?
//mysql
include("db.php");
//תנאי לשליחת טופס
if(isset($_POST["submit"])) {
$pass=$_POST["password"];
$user=$_POST["username"];
$query=mysql_query("SELECT * FROM admin WHERE username='$user'");
$row=mysql_fetch_array($query);
$dbuser=$row['username'];
$dbpass=$row['password'];
}
if($dbuser!=$user && $dbpass!=$pass) {
echo "you cant enter here";
} else {
echo"hello man";
}
echo <<<html
<title>login page</title>
<body>
<div align="center dir="rtl">
<strong>login</strong><br>
<post method="post">
username: <input type="text" name="username" id="username" />
password: <input type="password" name="password" id="password" />
<input type="submit" name="submit" id="submit" value="שלח טופס" />
html;
?>