forward variable info via header()
| From: | Bennett | Date: | Thu, 24 Aug 2000 18:43:54 +0000 |
| Subject: | forward variable info via header() | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-2341@lists.php.net to get a copy of this message | ||
Hello folks,
I'm a PHP newbie trying to figure one last piece of a
project that I've been working on this summer.
I'm trying to use php to forward information collected from
previous pages to a new page by way of a .php file using the
header function like this:
Header("Location: newpage.html");
but, I have a lot of info I'd like to pass along with it. So, I'm trying to
build this info into a variable like this:
$info = "branch_cd=", urlencode($branch_cd), "&name=",
urlencode($name) ... ; etc.
(the information in $branch_cd and $name is from the previous
page).
so that I can do this:
Header ("Location: newpage.html?$info");
But when I try to add the field names as text and the urlencoded
php variable information into the $info variable I get a parse error.
Basically, all I'm trying to do is forward the information collected in
the php variables from the previous page via the header function.
Does anyone happen to know how to do this?
I've also tried just building the url directly into header() like this:
Header("Location: newpage.html?branch_cd=",
urlencode($branch_cd), "&name=", urlencode($name));
But that doesn't work either. The url ends up only sending what's in
the first set of double quotes. It shows like this:
http://www.company.com/newpage.html?branch_cd=
and that's it.
Any help would be greatly appreciated.
Thank you,
PS. The reason I'm using Header(); is because I have the php file
making a decision as to which page to go to.