Re: $_SESSION $_POST
From: Markus Ernst (derernst_at_NO#SP#AMgmx.ch)
Date: 09/27/04
- Next message: Berislav Lopac: "Re: Performance inquiry"
- Previous message: Michael Satterwhite: "Return value from function"
- In reply to: mammothman42_at_hotmail.com: "Re: $_SESSION $_POST"
- Next in thread: Simon Stienen: "Re: $_SESSION $_POST"
- Reply: Simon Stienen: "Re: $_SESSION $_POST"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 27 Sep 2004 16:00:03 +0200
mammothman42@hotmail.com wrote:
> ahhh! fully confused! so should i be using SESSION variables or POST?
Sorry for confusing you with a joke. For using forms it is essential to know
the ways data get transmitted from the form to the server. See the very
useful overwiew Simon Stienen gave you in his answer.
> That is, how is this kinda thing usually done? i'm sure it's a fairly
> common problem.
Not a problem, just common.
> should i submit the form as SESSION, or is this a
> security flaw?
No it was a joke. You have to use POST or GET.
> it seems stupid using post, and then having to copy,
> one by one, the variables to SESSION. doesn't seem "right".
If you want a shortcut to get all your postdata into the $_SESSION array:
// This puts the post data at the end of the $_SESSION array:
$_SESSION = $_SESSION + $_POST;
// As an alternative, this will overwrite already existing entries with the
same keys in the session data:
$_SESSION = array_merge($_SESSION, $_POST);
But usually you will not want this, as you want to process the posted data
rather than store it into the session.
HTH
Markus
- Next message: Berislav Lopac: "Re: Performance inquiry"
- Previous message: Michael Satterwhite: "Return value from function"
- In reply to: mammothman42_at_hotmail.com: "Re: $_SESSION $_POST"
- Next in thread: Simon Stienen: "Re: $_SESSION $_POST"
- Reply: Simon Stienen: "Re: $_SESSION $_POST"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|