Re: Redirection Question (I spoke to soon)
| From: | Beauford.2005 | Date: | Thu, 24 Jul 2003 01:35:30 +0000 |
| Subject: | Re: Redirection Question (I spoke to soon) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-156366@lists.php.net to get a copy of this message | ||
Sorry all, apparently this doesn't work on either Windows or Linux.
Again, I thought it was working and once I got farther along I see that
it really wasn't. Basically what I get after I login is an empty screen.
Here is what I have :
This is the script that runs to see if the user is logged in.
session_start();
if(!$_SESSION['logged']) {
session_register('goto');
$_SESSION['goto'] = "http://" .
$_SERVER['SERVER_NAME'] .
$_SERVER['REQUEST_URI'];
$url = "http://www.mysite.org/login/login.php";
header("Location: $url");
}
The above works and redirects me to the login page and has the right
referring page as shown below.
goto|s:59:"http://www.mysite.org/setup/inputs.php";
This is in my login.php script. After I verify the user login is
correct, this piece of code is executed.
session_start();
session_register('logged');
session_register('user');
$_SESSION['logged'] = "True";
$_SESSION['user'] = $row['user'];
$target = "Location: " . $_SESSION['goto'];
session_unregister('goto');
header($target);
What I get after this is a blank page. The user has been logged in and
shows in the session file, but it just isn't redirecting.