I'm having problems accessing/passing old session variables after a user has 
logged in. I'm using Apache 1.3.23, PHP 4.1.2, and PostgreSQL 7.2.


My setup:

The first user form page, "sponsor" contains the user's name and data. The 
user then enters information into a second form page , "rap", with the name 
of another person . When completed the information for both is displayed in a 
third page ,"confirmation" He is offered the opportunity of adding more names 
into "rap".  There's no problem with all of this as long as the session is 
current. -- I've used $_SESSION and $_GET throughout.

I've created a user login page that gets the user's data from a PostgrSQL 
database and places into a session, i.e.  $_SESSION['sfname'] = 
$login['sfname']; $_SESSION['ssname'] = $login['ssname']; ,etc.
I can access the session array on that page. Viewing with print_r($_SESSION), 
all is as it should be. A header that points to the confirmation page: 
header("location:confirm.php?".sid"); opens that page.


My problem:

However, none of the array variables from "sponsor" (the first page) are 
present on the third page: i.e.  $_SESSION['sfname'] shows empty. Do I need 
to post them to the confirmation page using $_GET? How is it stored -- in his 
'id' in the database? I'm truly puzzled since I believe I've supplied 
everything that the database holds for this person. So, how do I reactivate 
an old session? I've tried, as above, to set the SELECT query's array  to 
$_SESSION['vars'] and other combos, but they don't work. 

Another short question: do you have to "name" the array from a query, i.e., " 
$login = blah, blah, blah" or, $_SESSION(login) or something like that, in 
order to get the variables to pass? If the user has logged in properly, how 
do you access his previous session? 

I'm probably missing something elementally simple her -- and I've read almost 
everything I can get my hands to understand how to do this, but I thought 
that the variables are automatically set. On the third page, for example, if 
I print_r[$_SESSION} all I see is that the second page's variables, ie. from 
"rap". The first page's variables do not want to pass.

Sorry for the long post, but I would greatly appreciate any insights on what 
I'm doing wrong here.

Tia,
Andre


-- 
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the Holy Souls in Purgatory.

May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to