Re: [PHP] php redirection..



Actually... Search engines don't have a JavaScript interpreter.

On 12/15/06, Richard Lynch <ceo@xxxxxxxxx> wrote:
On Tue, December 12, 2006 12:51 pm, Stut wrote:
> bruce wrote:
>> hey stut...
>
> Please don't reply to me directly, always include the mailing list.
>
>> thanks for the reply... i did get some output...
>>
>> i also have a question as to why i couldn't get it to work when i
>> used
>> 'header (foo.php)'
>
> 1) The correct way to redirect using the header function is
> header('Location: http://domain.com/foo.php'); Note the absolute URL.
> 2) Using header will definitely not display any output from the page.

You actually need to put in an exit; if you want to guarantee that PHP
won't send more data, and that the browser won't process it and show
it before doing the re-direct...

*MOST* of the time the Location: header gets processed so fast, you
don't see any following data, but if you pound on it enough, you'll
see that the browser *can* show the data after the re-direct, if it
feels particularly Orange at that moment in time.

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


.



Relevant Pages

  • RE: "Page Cannot Be Displayed" error with IE XP SP2
    ... If you have this in your header and submit a POST from the page, ... Now a consistent browser would not let you ... > an HTTP response from the server. ... > with no custom settings. ...
    (microsoft.public.inetsdk.html_authoring)
  • Re: Questions about HTTP headers sent with PHP in HTTP authentication
    ... And how are status codes sent to the browser if not?? ... and 5.1.2 the header function now prevents more than one header to be ... server send multiple response messages to one request?] ...
    (comp.lang.php)
  • Re: ampersand in urls when using xhtml 1.0 strict
    ... My web server is clearly seeing & and the browser is ... After including this header I was able to remove the encoded ... First, this is very strange because if your browser was displaying the page as HTML, then it was already receiving a content type header from the web server telling it that the page was HTML, or else there was no header and the browser was treating it as HTML by default. ...
    (comp.infosystems.www.authoring.html)
  • Re: ampersand in urls when using xhtml 1.0 strict
    ... My web server is clearly seeing & and the browser (FF ... After including this header I was able to remove the encoded ... the page as HTML, then it was already receiving a content type header ...
    (comp.infosystems.www.authoring.html)
  • Re: Confusing POST behavior -- doing it twice?
    ... The header you set will just do that: ... > 1 - When I start, there is no error message. ... Some just fetch the HTML from cache and display that. ... I have no idea how the current mostly used browser behave. ...
    (comp.lang.php)