EvilMaster
Registered
Правя си възможно най-елементарния логин скрипт, обаче мисля, че някъде бъркам в if-else, понеже ме логва с парола, различна от зададената.
index.php
login.php
index.php
Код:
<html>
<head>
<title>
We all start somewhere... right?
</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<form action="login.php" method="post">
Username: <input type="text" name="username" />
<br>
Password: <input type="password" name="password" />
<br>
<input type="submit" value="Вход" />
</form>
</body>
</html>
login.php
Код:
<html>
<head>
<title>
...RIGHT?
</title>
<?php
$username = $_POST["username"];
$password = $_POST["password"];
if ($username=="admin" and $password="admin") {
echo "Login Successful";
}
else {
echo "Login failed!";
}
?>
</html>