You are here: Re: PHP redirect timeout « PHP Programming Language « IT news, forums, messages
Re: PHP redirect timeout

Posted by Karl Groves on 11/18/17 11:43

Jerry Stuckle <jstucklex@attglobal.net> wrote in
news:ZsGdnYorq-4TNrTZ4p2dnA@comcast.com:

> Dave wrote:
>> Hi All,
>>
>> Can anyone suggest a reliable solution to php redirect?:
>>
>> header("Location: $redir_url");
>> if the above times out in $timeout seconds
>> header("Location: $alt_redir_url");
>>
>> Many thanks,
>>
>> Dave
>>
>>
>
> Hi, Dave,
>
> Sorry, you can't do it.
>
> When you send the redirect, the request goes to the browser. The
> browser is now responsible for fetching the new page. Your script is
> no longer "in the loop".
>
> Maybe you could do it with javascript - I haven't tried. But that
> would have its own problems (i.e. user has disabled javascript).
>

Actually, what could be done is to check for a good response at new URL
with fsockopen() and if successful, do the redirect, otherwise go to the
alternate.

To the OP:
peruse the info here: http://us2.php.net/function.fsockopen



--
Karl Groves
http://karlcore.com
http://chevelle.karlcore.com

Accessibility Discussion List: http://smallerurl.com/?id=6p764du

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация