any body have idea about diff in window.loaction & header of php

Discussion in 'Javascript' started by 2291980, Feb 19, 2007.

  1. 2291980

    2291980 Guest

    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
     
    2291980, Feb 19, 2007
    #1
    1. Advertising

  2. 2291980

    Ian Collins Guest

    Re: any body have idea about diff in window.loaction & header ofphp

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

    Then why not ask on comp.lang.php?

    --
    Ian Collins.
     
    Ian Collins, Feb 19, 2007
    #2
    1. Advertising

  3. 2291980

    pcx99 Guest

    Re: any body have idea about diff in window.loaction & header ofphp

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


    The first will redirect the visitor only if they have javascript
    enabled. The second will redirect all visitors regardless of if they
    have scripting enabled or not.


    --
    http://www.hunlock.com -- Musings in Javascript, CSS.
    $FA
     
    pcx99, Feb 19, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kishkin
    Replies:
    2
    Views:
    378
    Diez B. Roggisch
    Jan 30, 2006
  2. Dr Mephesto

    App idea, Any idea on implementation?

    Dr Mephesto, Feb 4, 2008, in forum: Python
    Replies:
    3
    Views:
    720
    Dennis Lee Bieber
    Feb 5, 2008
  3. Replies:
    0
    Views:
    635
  4. Rajive Narain
    Replies:
    0
    Views:
    1,867
    Rajive Narain
    Sep 18, 2009
  5. Pioneer
    Replies:
    6
    Views:
    82
    Tad McClellan
    Aug 17, 2005
Loading...

Share This Page