|
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]
|