Trying to redirect with header("Location: ")
| From: | webmaster | Date: | Thu, 27 Jul 2000 17:42:19 +0000 |
| Subject: | Trying to redirect with header("Location: ") | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-8616@lists.php.net to get a copy of this message | ||
I'm trying to redirect a user after filling out a form the process SHOULD =
work like this:
User opens page which checks for cookie "usertype" or "usertypesaved" if =
the cookies are not found, user is redirected to a form to fill out what =
kind of user he/she is. HTTP_REFERER is added as the value of a hidden =
form field, so that I can return the user to their original location with =
usertype set.
On submit, the script calls setusertype.php (the code below)
---SNIP----
<?php
setcookie("usertype", $userType, 0, "/", ".myserver.com", 0);
if ($save=3D=3D"on" || $save=3D=3D"On") {
$expire =3D time() + 63072000;
setcookie("usertypesaved", $userType, $expire, "/", =
".myserver.com", 0);
}
header("Location: $referer");
?>
--SNIP----
Problem: This works just as it should on mac/IE 5, but not Netscape or any =
browser on windows. On those browsers, it returns the user to the =
directory that the php scrip it is in.
Any ideas?
P.S. I cannot use session variables for this process (at least, not very =
easily), because usertype must be available to seperate web server, not =
running php/apache.
Dave