Re: Redircetion and Browser-Type
| From: | Eris Ristemena | Date: | Fri, 28 Jul 2000 23:33:45 +0000 |
| Subject: | Re: Redircetion and Browser-Type | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-8884@lists.php.net to get a copy of this message | ||
that's why i usually use exit(); after header('Location:
http://www.php.net/');
- eris
-----Original Message-----
From: Jesper Juhl <juhl@eisenstein.dk>
To: php-general@lists.php.net <php-general@lists.php.net>
Date: Friday, July 28, 2000 10:48 PM
Subject: RE: [PHP] Redircetion and Browser-Type
>
>> The first one will because it redirects before anything is even sent to
>the
>> browser so it's browser non-dependant. The second might be browser
>specific
>> I don't know.
>
>> Jason
>
>
>That's how it's supposed to be, but reality is a bit different.
>
>If I place the following script on my Apache 1.3.12 server running
>PHP4.0.0 and then get it via http/1.1 then I get both the location header
>/and/ the document body.
>
>
><?php
>header('Location: http://www.php.net/');
>echo 'You should not see this as you have been redirected';
>?>
>
>
>Here's a dump of my telnet session :
>
>$ telnet jesper.staff.groundcontrol.dk 80
>Trying 213.237.12.238...
>Connected to www.groundcontrol.dk.
>Escape character is '^]'.
>GET /locationTest.php HTTP/1.1
>Host: jesper.staff.groundcontrol.dk
>
>HTTP/1.1 302 Found
>Date: Sat, 29 Jul 2000 03:42:27 GMT
>Server: Apache/1.3.12 (Unix) PHP/4.0.0 mod_ssl/2.6.4 OpenSSL/0.9.5a
>X-Powered-By: PHP/4.0.0
>Location: http://www.php.net/
>Transfer-Encoding: chunked
>Content-Type: text/html
>
>33
>You should not see this as you have been redirected
>0
>
>Connection closed by foreign host.
>
>
>So as you see, you depend upon the fact that the browser honors the
>Location header (and any compliant browser should), but in fact it is
>possible to ignore it.
>
>
>Jesper Juhl
>juhl@eisenstein.dk
>
>
>
>--
>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
>