You are here: Re: can any body tell me the dff between Rredirect through javascript & header « PHP Programming Language « IT news, forums, messages
Re: can any body tell me the dff between Rredirect through javascript & header

Posted by Captain Paralytic on 02/19/07 12:55

On 19 Feb, 12:40, "2291980" <stephenhb...@gmail.com> wrote:
> Hello
>
> can any body tell me the dff between
> function redirect($url)
> {
> echo "<script>";
> echo "window.location='".$url."'";
> echo "</script>";
>
> }
>
> and
>
> header("Location $url")
>
> syntex belong to php

When a browser sees header("Location whatever-is-the-value-of-$url")
it will barf because it should say header("Location: whatever-is-the-
value-of-$url").

However, supposing that you had put the correct value in the call
then, as soon as it sees the header location value, it can go off to
get the new page. With
function redirect($url)
{
echo "<script>";
echo "window.location='".$url."'";
echo "</script>";
}
it has to load your page before it can see the script to execute.

 

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

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