Page 1 of 1

$_POST usage... little rookie help

Posted: Tue Apr 04, 2006 9:59 am
by pedrotuga
I guess this question should have been asked a thousand times... but searching for $_post doent get me anywhere.

i am using php5... and i have asimple question:

when does $_posted is updated/destroid?

like...

if I

$_POST["foo"]="you dude";


then redirect to other script... then do stuff without touching $_POST... then redirect to some other...
can i still access $_POST ?

Posted: Tue Apr 04, 2006 10:34 am
by feyd
pedrotuga wrote:then redirect to other script... then do stuff without touching $_POST... then redirect to some other...
can i still access $_POST ?
It depends on how you do the redirection and can be affected by the browser involved as well. Header redirection, some browsers will continue to pass the post data along, some will not. With meta or page level redirection the data will be lost on subsequent pages. It is suggested that one should use the session variable system to keep the data on the server (and use meta/page level redirection) so the user's browser doesn't have to send the data over and over when it's not getting used.

Posted: Tue Apr 04, 2006 12:29 pm
by pedrotuga
mmmm...,ok... i see... so it is recomended to keep the data in the sesion variables instead.

BTW... just by curioity...
what about going from one page to another, to another to another using links?

Posted: Tue Apr 04, 2006 12:36 pm
by feyd
sessions. If you don't want the user to be able to fiddle with the data, sessions, sessions, sessions.

Posted: Tue Apr 04, 2006 12:38 pm
by pedrotuga
feyd wrote:sessions. If you don't want the user to be able to fiddle with the data, sessions, sessions, sessions.
sessions shall be ;)