Posted by Garry Jones on 10/18/06 14:21
This is a excerpt from the code where I collect data with a form.
<FORM action="index15dq.php" method="post" name="stegscf_pwd_edit"
id="stegscf_pwd_edit">
I am setting three session variables to already declared variables. I then
echo them and can see on the resulting form that they are set correctly.
<?
session_start();
$_SESSION['scf_upd_pwd'] = $scfmpwd1;
$_SESSION['scf_upd_num'] = $scfchknum;
$_SESSION['scf_upd_nam'] = $scfmfor;
echo $_SESSION['scf_upd_pwd'];
echo $_SESSION['scf_upd_num'];
echo $_SESSION['scf_upd_nam'];
?>
On the processing page - index15dq.php - I have this code.
<?
error_reporting(E_ALL);
session_start();
$scfmpwd1 = $_SESSION['scf_upd_pwd'];
$scfchknum = $_SESSION['scf_upd_num'];
$scfmfor = $_SESSION['scf_upd_nam'];
print "values";
echo $scfmpwd1;
echo $scfchknum;
echo $scfmfor;
?>
Its echoing blank values. No errors reported.
Shouldn't this work? How can I force session varables to work. Does it
matter where session_start is declared?
My pages are complex. First I open an index which looks at certain key
values, the page is then dynamicaly put together using segments of php code,
certain segments are omited or included according to which page is being
loaded. Much of these form the surrounding information, the headers, the
pictures and banners and the meny bar on the left of the screen.). All of
which can vary accordning to which page is being loaded.
Eventually the nitty-gritty of the page is loaded in the centre.
It is here that I am a) declaring loading the session variables.
and b) trying to use the loaded session variables.
Somewhere along the way they are being unloaded.
Garry Jones
Sweden
[Back to original message]
|