The coding style needs to match the register_globals setting in php.ini.
register_globals on:
$accountsession = $session;
$accountemail = $email;
session_register("accountsession");
session_register("accountemail");
register_globals off:
Do just like you have it below, except remove the calls to session
_register().
Kirk
> -Original Message-
> From: Johan Holst Nielsen [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 25, 2002 6:14 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Won't save session ids?
>
>
> Hi people,
>
> I have a problem with my PHP scripts. I hope someone can help me?
> I run PHP 4.0.6, Redhat 7.1
>
> When i tries to set a session and then redirect to the next page, the
> sessions is empty? Someone know how to solve this problem?
>
> The script looks like this:
>
> session_start();
> session_register("accountsession");
> session_register("accountemail");
> $HTTP_SESSION_VARS["accountsession"] = $session;
> $HTTP_SESSION_VARS["accountemail"] = $email;
> header("Location: ./main.php");
>
> //The session and email variabel is from a output from a
> mysql query!!
> And this works fine!
>
> The mainpage tries to get the sessions.
>
> session_start();
> echo
> "Email:".$HTTP_SESSION_VARS["accountemail"]."".$HTTP_SESSI
> ON_VARS["accountsession"];
>
> But i just get a "Email:" without any content?
>
> Please help me? Someone know whats wrong?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php