Page 1 of 1

sending variables before a redirect??

Posted: Sun Mar 16, 2003 6:39 am
by josboogz
Hi all,

I was wondering is it possible to send all the variables within a form to another page just before using the redirection command in PHP, i.e. header("Location:address.php"). I know by posting or getting in forms is the easiest way but is the way i described possible?

thanks for ur time,


Jos

Posted: Sun Mar 16, 2003 12:29 pm
by m3mn0n
Good question. I never did get to the bottom of that issue so i just used html meta tags to do my refreshing.

Code: Select all

<meta http-equiv="refresh" content="5; url=page.php">
I don't like the fact that header() doesn't have a delay like the meta tag does. Hopefully it will in a later release of php.

Posted: Sun Mar 16, 2003 12:38 pm
by Stoker
header() is a a function that outputs data in the http header which is always sent before any content, so there is no way you can force a delay after page content is output by manipulating any headers..

Doing an 'invisible' post or get to another page behind the sceenes is possible with curl or standard (http) file functions, if you just want to pass the data on to the redirected page you can do that either by urlencoded data in the new url (get) or by creating a session and storing the data in it..

Posted: Sun Mar 16, 2003 12:43 pm
by josboogz
Cheers guys will look into it.

Thanks for reply, much appreciated.

jos

Posted: Sun Mar 16, 2003 1:16 pm
by m3mn0n
Stoker wrote:header() is a a function that outputs data in the http header which is always sent before any content, so there is no way you can force a delay after page content is output by manipulating any headers..
I know all that, what i was getting at with my bitching was the fact that they should, along with the already existing header("location: http://blah.com"), a new built in function that works similar to the HTML meta refresh. But this new one let's the page load instead transport a user before.