There are many different ways to do this ...

1. Have the same PHP script that validates generate the login page. 
This way the script always has the correct data and you don't need to 
pass anything.

2. Header("Location: login.php?err=$err&user=$user&pass=$pass");
This will work, but the bad password will be visible in the query string.

3. Start a session at the login page and register the variables you 
need to use on the login page.


>I wonder if someone could tell me whether or not the following is
>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
>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,
>PHP General Mailing List (
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

Jim Musil
Multimedia Programmer

PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to