$_POST, header()

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
jonathant
Forum Commoner
Posts: 32
Joined: Sat Jan 07, 2006 3:13 pm

$_POST, header()

Post by jonathant »

Can you pass $_POST variable data without using a form? Specifically, I am trying to use header("Location: http://www.domain.com/index.php") to redirect the script, but I need it to hold onto the $_POST data. Is this possible?
pilau
Forum Regular
Posts: 594
Joined: Sat Jul 09, 2005 10:22 am
Location: Israel

Re: $_POST, header()

Post by pilau »

As far as I know, there is no other way. But I don't know much far :P
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

you can use cURL to post variables to a page
RobertPaul
Forum Contributor
Posts: 122
Joined: Sun Sep 18, 2005 8:54 pm
Location: OCNY

Post by RobertPaul »

You can do it with 307 Temporary Redirect, but it'll prompt the user if they want to resend the POST data.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Are you redirecting to a page on your site? If so you could save the $_POST data in a session.

Mac
jonathant
Forum Commoner
Posts: 32
Joined: Sat Jan 07, 2006 3:13 pm

Post by jonathant »

twigletmac wrote:Are you redirecting to a page on your site? If so you could save the $_POST data in a session.

Mac
Yes, I am redirecting to a page on my site. Is the $_SESSION variable only available in the current script? How could I pass it to the next script that I'm trying to redirect to? Does header() or a similar function support passing data?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

all your questions are answered by reading about what sessions are and how they work.


http://php.net/session
jonathant
Forum Commoner
Posts: 32
Joined: Sat Jan 07, 2006 3:13 pm

Post by jonathant »

wow, sessions are neato!!
Post Reply