Can somebody explain why when I use header as in the following context a new session is started ie with a different session ID. As such I lose the variable $account_id which I register.
script.php
To fill in a form to login (not a mysql userid just a subscriber id and post it to script1.php*/
script1.php
<?php
include ("session_mysql.php");
session_start();
session_register("account_id");
function getaccountid($account_id)
{
/ a bit of sqlcode which is used to extract from the account table (mysql)
/
/if person logging in has an account redirect to script2.php and in addition pass on the session id/
header("Location: script2.php?SID")
}
getaccountid(&$account_id);
?>
script2.php
<?php
include("session_mysql.php");
session_start();
/ a bit of mysql to retrieve the details based on the $account_id, but it doesn't appear to be passed on and the session ID has changed /
?>
...
Can somebody tell me why this is happening?
Thanks
Ps the session_mysql.php is from Ying Zhang.