Set the form receiver to $PHP_SELF. When data is posted (use $HTPP_POST_VARS to check if is) check it for correctness. If everything is ok, use Header("Location: work_for_authorized.php") otherwise show the current (i.e. login page) with $user, $pass available...
Zliy PEs, http://www.zliypes.com.ua ----- Original Message ----- From: "Lee Philip Reilly" <[EMAIL PROTECTED]> To: "PHP List" <[EMAIL PROTECTED]> Sent: Tuesday, December 04, 2001 7:46 PM Subject: [PHP] header("Location:blah...") - passing variables > Hi, > > I wonder if someone could tell me whether or not the following is > possible? > > I have an HTML form which passes a username and password to a PHP script > for validation. If either is not valid, I would like it to return to the > previous page - carrying with it a variable plus the submitted form > information... > > =-=-=-=-=-=-=-=-= > if (strlen ($password1) <4 ) { > $err = "Password must be more than 4 characters long"; > header("Location:http://somelocation.php"); > // ^-- at the location, the $err and form variables will be available > > exit; > } > =-=-=-=-=-=-=-=-= > > Is it possible to this without using an HTML form? > > Thanks very much in advance. > > - Best regards, > > Lee > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]