Re: Help in php
| From: | jeremy brand | Date: | Wed, 11 Oct 2000 06:36:22 +0000 |
| Subject: | Re: Help in php | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-19522@lists.php.net to get a copy of this message | ||
Rasmus,
I'm not seeing that this is the case, at least with the CGI
binary -- and I would expect that a module would do the same thing.
Please correct me if I'm wrong. I think what you mentioned would be
good for in that many people that are web programmers these days don't
know HTTP inside and out -- but I've never been witness to what you
say.
Here is my example with both php3 and php4:
$ cat foo
<?php
header('Location: http://www.nirvani.net/');
?>
$ php3 -v
3.0.11
$ php3 foo
Location: http://www.nirvani.net/
Content-type: text/html
$ php4 -v
4.0.2
$ php4 foo
Location: http://www.nirvani.net/
Content-type: text/html
-jeremy brand
_______________________________________________________________________
GnuPG Fingerprint: 9F5E 95E0 1CC2 E054 84EA 6099 8ACD 9DBA D2C0 5EA9
_ http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html
for more __
On Tue, 10 Oct 2000, Rasmus Lerdorf wrote:
> Date: Tue, 10 Oct 2000 23:24:59 -0700 (Pacific Daylight Time)
> From: Rasmus Lerdorf <rasmus@php.net>
> To: jeremy brand <jeremy@nirvani.net>
> Cc: Joe Stump <joe@earth.care2.com>, umesh s <umeshivaswamy@usa.net>,
php-general@lists.php.net
> Subject: Re: [PHP] Help in php
>
> > I just want to correct this error that floats around on this list all
> > the time. If you are going to send HTTP headers, make sure and speak
> > HTTP.
> >
> > for example:
> >
> > header('302');
> > header("Location: $URL");
> >
> > 302 may not be what you want to say, maybe you want to say 303? It is
> > up to you the application developer. See the HTTP spec (found at
> > http://www.w3.org/) for more information.
> >
> > I know that this is anal, but if you are going to build an
> > application, you might as well do it right. (It doesn't take any more
> > effort).
>
> Perhaps a tad too anal. Sending a header('Location: blah') will
> automatically cause PHP to send back a 302. your header('302') is
> redundant.
>
> -Rasmus
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>