From: "Joel Ricker" <joejava@dragoncat.net>
A couple of ways to do this, plus others I'm sure that I'm not covering.
Thanks for the info. I got the two ways you mentionned to work fine. The problem I am having is with session vars not "sticking" when I load the new page. Here is my code:
session_start();
if(!isset($userid)) {
login_form();
exit;
}
else {
session_register("userid", "userpassword");
$username = auth_user($userid, $userpassword);
if(!$username) {
session_unregister("userid");
session_unregister("userpassword");
echo "Authorization failed. " .
exit;
}
else {
$id = session_id();
header("Location: main.php?$id");
exit;
}
}
The page is redirected fine but $userid and $userpassword are unset on the page. If I echo them out I get nothing .... why?
I have read the archives for this group and so far I have seen three ways of passing the session ID when using header() and none of them have worked except for the above. And even this one doesn't preserver session vars ...
i.e. Header ("location:www.your_url.com?".SID); //don't work
I even read one article that said it was impossible in PHP to pass vars from one PHP file to another file 3 levels down ...
http://www.faqts.com/knowledge_base/view.phtml/aid/1961/fid/8
I am truly at a loss and getting frustrated ^_^.
Jc
_________________________________________________________________
Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp