Re: setting sessions in a form



On 08/21/2006 04:22 PM, christopher.j.just@xxxxxxxxx wrote:
I'm just starting to use session with my forms in an attempt to lock
down some of the less secure issues with global variables and such.
However, I'm having trouble getting the variables to return.

The form process is pretty basic - a simple registration form with a
number of fields that passes to an intermediate page where there is an
opportunity to update incorrect information and then a final move to a
confirmation page.

Previously I had used hidden includes to move data from one page to
another but I would prefer a more elegant solution by using session. I
know that I set the session_start();, but am not sure on what page and
how to retrieve the information stored. I'm looking for the absolute
beginner starting point and I can build off that, but I'm a bit lost at
the moment.

Thanks for any help,
Chris


I'm something of a newbie to php too, but I think that, after session_start() is called, this should work:

$_SESSION['myform'] = $_POST;

Everything in the form would be stored in the 'myform' element of the session.
.



Relevant Pages

  • setting sessions in a form
    ... I'm just starting to use session with my forms in an attempt to lock ... down some of the less secure issues with global variables and such. ... The form process is pretty basic - a simple registration form with a ...
    (php.general)
  • Re: global variables
    ... Global variables are pretty much the variables you shouldn't use at all if you plan on writing PHP applications that are stored in more than like three files. ... Every PHP script on a webserver is started after a request is made. ... Cookies data has "session persistence" or even "multi-visit persistence", depending on the settings in the visitor's browser and the expiration time you set for the cookie. ...
    (comp.lang.php)
  • Re: Advice on mod_lisp-based web application.
    ... I have much state in global variables, ... structure that includes, along with the variable value, a session id. ... dependent on what you need to track, but essentially some sort of structure ... tcross rapttech dot com dot au ...
    (comp.lang.lisp)
  • Problem with session variables on Mac
    ... Global variables are OFF. ... I start a session at the very ... some debugging help. ... Jim Feldman ...
    (php.general)
  • Re: Looking for the simplest method to send some bytes from mirror display driver to application?
    ... "Calvin Guan" wrote in message ... Windows Network, Video, WDM Device Driver Training & Consulting ... >> variables will only be available when the session is mapped. ... when they try to access global variables that were ...
    (microsoft.public.development.device.drivers)