Re: How do I set Session Variables



Dear Chris,

First of all you need to initialize the session :
session_start();

You have to do this on every page during the session. I'm not sure, but
it's possible that you have to put this in the script before any
output...

After that, the session variables are stored in the array $_SESSION[] :
session_start();
$_SESSION['foo'] = "bar";
---- next page ----
session_start();
echo $_SESSION['foo'];


kind regards,
Mathew


christopher.j.just@xxxxxxxxx wrote:
I'm starting with a form that has 23 fields and I need to be able to
pass and recall the information from page to page as people move
through the form process.

How do I set the variables to include all the form elements and how do
I recall them in each subsiquent page.

Previously we had been using hidden includes, but we're looking for a
more elegant and consistant solution.

Thanks,
Chris

.



Relevant Pages

  • Re: DAW Wars-Current thinking? (long)
    ... Thanks for all the replies on this thread; ... the last mix session, you wonder what might have been missed. ... At least with "instant" mix recall, I'm relatively sure everything is back ... Then there's the issue of all the other analog stuff in the chain I still ...
    (rec.audio.pro)
  • Re: Apache vs IIS
    ... to manage SESSION cockies for a particular site. ... So you don't recall it correctly. ... client application doesn't need to call the server for every interaction ... understand to do this in PHP you have to store the values in SESSION ...
    (alt.php)
  • [Full-disclosure] RE: Session data pollution vulnerabilities in web applications
    ... initialize a session only after a successful login. ... I have seen this kind of bugs (not only related to logins and passwords, ... available - just grep for lines where the session variables are ...
    (Full-Disclosure)
  • Re: QUESTION ON SEQUENCE VALUES - 9iR2
    ... In article, Brian Peasland ... into a variable so that I can recall it later. ... The CURRVAL value should survive for the duration of your session. ... some apps like many web apps do not always use the same session for the ...
    (comp.databases.oracle.server)
  • Re: Apache vs IIS
    ... to manage SESSION cockies for a particular site. ... up in Apache but I recall that is for the entire webserver. ... So you don't recall it correctly. ... PHP you have to store the values in SESSION cockies then check the SESSION ...
    (alt.php)