I'm not sure, but I think that you can do some like this.
login.php
<?php
if(isset($login))
{
if(empty($username)||empty($password))
{
print "You must fill in all fields!");
}
else
{
session_start();
$_SESSION['username'] = "$_POST['username']";
$_SESSION['password'] = "$_POST['password']";
}
}
else
{
print "<form action=\"login.php\" method=\"post\">\n";
print "<input type=\"hidden\" name=\"login\">\n";
print "Username: <input type=\"text\" name=\"username\"><br>\n";
print "Password: <input type=\"password\" name=\"password\"><p>\n";
print "<input type=\"submit\" value=\"Login\">\n";
print "</form>\n";
}
?>
Do not entirely trust this code; I'm a newbie!