Today’s post is very simple. I’d like you guys to learn on how to create a really simple form. And it may looks difficult, but you should really try it first and you’ll understand later how simple this thing is. So here’s the code.
<form action=”login.php” method=”POST”>
<input type=”text” name=”user”>
<input type=”pass” name=”pass”>
<input type=”submit” name=”submit”>
$user = $_POST[‘user’];
$pass = $_POST[‘pass’];
if($user==”me” AND $pass==123)
echo “Wrong Username / Password.”;
Right now, login.php is the file that has this code.. and if the login is correct which is set to have the username of “me” and password 123, it will be redirected to login2.php. So maybe my next post would be more interesting with the use of session so that you can login and logout.
Any inquiries, mail me at email@example.com