Re: use SESSION variable?
- From: Michael Fesser <netizen@xxxxxx>
- Date: Mon, 30 Jun 2008 13:26:57 +0200
..oO(Tim Roberts)
"Twayne" <nobody@xxxxxxxxxxxxxxxxxxx> wrote:
My actual question is: How do I get a POST variable into a session
variable so I can use it in any other page I want to use it in?
Apparently posted variables are only available in the Form page in
the file called by Action=, right? But I'd like to use it in other
places.
There are several ways to do this. A $_SESSION variable is one way, and in
many cases that's the most convenient. However, if you have a bunch of
pages with <form>s that succeed one another, it's also possible to pass
this kind of information as <input type=hidden> variables without the
overhead of a session.
Bad idea. Sessions are made for this. It's the hidden fields that cause
the real overhead on the network and the server:
* The same data has to be transferred back and forth between the server
and the client multiple times, wasting bandwidth.
* You have to re-validate the same data over and over again on every
single form submission, because even hidden fields can be manipulated.
With a session you do it all just once: you receive the data, validate
it, store it in the session and that's it. The overhead caused by the
session handler is not really an issue.
Micha
.
- References:
- use SESSION variable?
- From: Twayne
- Re: use SESSION variable?
- From: Tim Roberts
- use SESSION variable?
- Prev by Date: Re: how to store the path of uploading file....
- Next by Date: Re: use SESSION variable?
- Previous by thread: Re: use SESSION variable?
- Next by thread: Re: Oportunidad Nissan Tiida nuevo
- Index(es):
Relevant Pages
|