Reply to Re: can any body tell me the dff between Rredirect through javascript & header

Your name:

Reply:


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

On 19 Feb, 12:51, "Martin Mandl - m2m tech support"
<martin.ma...@gmail.com> wrote:
> On Feb 19, 1:40 pm, "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
>
> Dear Stephen,
>
> In the first solution PHP creates a JavaScript and sends it via a
> 'normal' HTML page to the browser. If the browser has JavaScript
> enabled it loads the new URL. If it is disabled, nothing happens.
>
> In the second solution PHP sends a redirect statement with the URL to
> the browser. The browser loads the new URL.
>
> Cheers
> Martin
>
> ------------------------------------------------
> online accounting on bash bases
> Online Einnahmen-Ausgaben-Rechnunghttp://www.ea-geier.at
> ------------------------------------------------
> m2m server software gmbhhttp://www.m2m.at- Hide quoted text -
>
> - Show quoted text -

Not quite. In the second situation you should get an error because the
header is invalid. It should have a colon after Location.

[Back to original 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

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