Page 1 of 1

header()

Posted: Mon Jun 13, 2005 6:09 pm
by haoest
Hello all,

I am having difficulty picking up parameter to header() fucntion.

I downloaded the rfc2616 documentation, but it is so hard to hard.
Does any one know of any tutorials that can set me on my way?
More specificly, I want to know how to redirect the browser with certain variables. If you can give me examples, that would be awsome.

Thanks alot,

Hao

Posted: Mon Jun 13, 2005 6:17 pm
by John Cartwright

Code: Select all

header('Location: index.php?var=value&othervar=othervalue');
these varibles will be accessible through $_GET['var'] and $_GET['othervar']

Posted: Tue Jun 14, 2005 4:48 am
by Syranide
Jcart wrote:these varibles will not be accessible through $_GET['var'] and $_GET['othervar']
.. they are (don't see why they shouldn't be either)... but I've used it in some hackish pages and I get them as through any other page.

Edit | Typo fixed

Posted: Tue Jun 14, 2005 5:28 am
by shiznatix
they definatly are accesable through get, i think jcart made a typo

Posted: Tue Jun 14, 2005 6:18 am
by timvw
And don't forget to encode your values ;) http://www.php.net/urlencode

Posted: Tue Jun 14, 2005 6:45 am
by John Cartwright
Whoops big typo :roll: