Re: redirect to new page and pass variables too? (fwd)
| From: | Miguel Cruz | Date: | Wed, 24 Apr 2002 22:33:20 +0000 |
| Subject: | Re: redirect to new page and pass variables too? (fwd) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-94463@lists.php.net to get a copy of this message | ||
On Wed, 24 Apr 2002, Pushkar Pradhan wrote:
> I am collecting some data on a page - test.php, ($layer which is an array
> of names).
> If checkbox is checked that user wants to change drawing order, I should
> redirect the browser to page - "updateHTML.php" which has necessary script
> to do that.
> I achieved redirection using header(), but can't pass the $layer array
> with it.
> I tried something like:
> form..
> input type hidden layer...
> header()
> but then the page isn't redirected since I get a warning that headers have
> been sent before the execu. of this line.
> What is the way to do this? I don't want to do include since it will put
> the contents of both the scripts on the same page.
header('Location: updateHTML.php?layer='
. urlencode(serialize($layer)));
and then inside updateHTML.php
$layer = unserialize($_REQUEST('layer'));
miguel