Re: Help: header function

From: Date: Fri, 26 Jul 2002 16:49:49 +0000
Subject: Re: Help: header function
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-109791@lists.php.net to get a copy of this message
>Kamesh's trouble was he was refering to something like >http://mypage.php . I figured it would save time to just get rid of the protocol and go relative. I'm aware of the spec for header, but I have always used a relative URI and just about all the code I've seen uses relative also. I would be interested to know of any possible problems as well. I suppose it would be good practice to start using it correctly. I mean, even with trans-sid set to "on" session ID's are never sent in header redirects or anything containing a full URI anyway so it's not like it's going to mess anything up... unless you moved your code from one site to another and hard coded your full URI in all your header redirects... yikes!!. That's when a main config file would come in real handy :-) Jim Grill Support Web-1 Hosting http://www.web-1hosting.net ----- Original Message ----- From: "Matt" <mschroebel@epooch.com> To: <php-general@lists.php.net> Cc: <kameshn@csa.iisc.ernet.in> Sent: Friday, July 26, 2002 11:27 AM Subject: Re: [PHP] Help: header function > >From: "Tech Support" <jgrill@web-1hosting.net> > > To: "k a m e s h" <kameshn@csa.iisc.ernet.in>; <php-general@lists.php.net> > >Sent: Friday, July 26, 2002 11:20 AM > >Subject: Re: [PHP] Help: header function > > > > Try just header("Location: $PHP_SELF"); or header("Location: > $SCRIPT_NAME") > > ...leave out http:// ...and your quotes are in the wrong > > place too. > > I know that works but the spec for http/1.1 says it's supposed to have the > absoluteURI including the scheme, and host, > see http://www.php-faq.com/httpheaders.php#14.30. > Kamesh's trouble was he > was refering to something like http://mypage.php -- which was > missing the > host name. I've coded lots of headers() with relative URIs [i.e. > header('Location: mypage.php')] without trouble (at least that I know of). > Has anyone run into trouble using only the page name? Is this something to > worry about or not? > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

« previous php.general (#109791) next »