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

Your name:

Reply:


Posted by Martin Mandl - m2m tech support on 02/19/07 12:51

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-Rechnung
http://www.ea-geier.at
------------------------------------------------
m2m server software gmbh
http://www.m2m.at

[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

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