Hi.

I am creating a simple login script which doesn't use MySQL or a text file.

PHP Code:
$user $_POST["user"];
$pass $_POST["pass"];

if (!
$submit) {
 echo 
"<form action=\"admin.php\" method=\"post\">
  <input type=\"text\" size=\"20\" maxlength=\"19\" name=\"user\" />
  <input type=\"password\" size=\"20\" maxlength=\"19\" name=\"pass\" />
  <input type=\"submit\" maxlength=\"19\" value=\"Submit\" name=\"submit\" />
  </form>"
;
 }
 else {
  if (
$user != "admin" || $pass != "password") {
   echo 
"Error!  Incorrect Username or Password!
   <form action=\"admin.php\" method=\"post\">
input type=\"text\" size=\"20\" maxlength=\"19\" name=\"user\" />
   <input type=\"password\" size=\"20\" maxlength=\"19\" name=\"pass\" />
   <input type=\"submit\" maxlength=\"19\" value=\"Submit\" name=\"submit\" />
   </form>"
;
  }
  else {
   echo 
"Login successful";
  }
 }
 if (
$page == "test") {
  echo 
"This is the test page";
 } 
I am trying to keep all of this in one file, and also add another page with an option on it. However, when I do so, the form fields come up again because it hasn't been submitted. Is there any way to overcome this?

Thanks