"comp.lang. php" <ph************ **@gmail.com> wrote in message
news:11******** **************@ v46g2000cwv.goo glegroups.com.. .
This is an urgent request (as always)
- generate_admin_customer_position_dropdown($customerResult,
- $customerResult[0]->id);
- print_r($_SESSION["${projectAcronym}_customerSOWObjectArray"]);
-
This code will generate an HTML dropdown as well as set a $_SESSION
variable.
I can verify the function works perfectly and in fact sets the session
variable every time. Problem is that I need to set and then
IMMEDIATELY get the session variable w/o redirection because
redirection is undoable at the portion of the PHP code that this must
work in.
What do I do? Each time I try this the session variable is NOT
immediately available until a latter iteration renders it available but
far too late to be used.
How do I set and then IMMEDIATELY get a SESSION variable? This is an
urgent request!!
Thanx
Phil
Not exactly sure what you mean... How can you verify that the $_SESSION
variable is set if you also state you can't access it.
place this before your print_r statement: echo "<!-- SESSION
status:\n\r".va r_dump($_SESSIO N)."\n\r-->";
then look in the source code of the resulting page. This will show you all
the $_SESSION variables and their values.
I can set a session and immediatley access it all day long... it has to be
something else. To me it appears that this could be the culprit:
print_r($_SESSI ON["${projectAcron ym}_customerSOW ObjectArray"]);
....what is "${projectAcron ym}_customerSOW ObjectArray"? In otherwords what
is 'projectAcronym '? It can do it this way too, no problem. If
'projectAcronym ' is a variable (it really has a $ in front of it) then you
need to make sure it is set properly. The $ can go inside the curly braces
as well and should keep things easier to read. Just try entering the little
code snippet above and you'll see what the session variables are.
Norm