Re: header("Location:blah...") - passing variables

From: Date: Tue, 04 Dec 2001 17:47:45 +0000
Subject: Re: header("Location:blah...") - passing variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-76558@lists.php.net to get a copy of this message
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. Jim
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
-- Jim Musil --------- Multimedia Programmer Nettmedia ------------- 212-629-0004 jim@nettmedia.com

« previous php.general (#76558) next »