$_POST usage... little rookie help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

$_POST usage... little rookie help

Post 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 ?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

sessions. If you don't want the user to be able to fiddle with the data, sessions, sessions, sessions.
User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

Post 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 ;)
Post Reply