Re: header("Location:blah...") - passing variables
| From: | Valentin V. Petruchek | Date: | Tue, 04 Dec 2001 17:54:55 +0000 |
| Subject: | Re: header("Location:blah...") - passing variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-76559@lists.php.net to get a copy of this message | ||
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" <lreilly@lanl.gov>
To: "PHP List" <php-general@lists.php.net>
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: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>