Open URL

Discussion in 'PHP' started by neolegionar, Jun 16, 2007.

  1. #1
    Does anyone know how can i open an URL in the current window using a PHP function?
     
    neolegionar, Jun 16, 2007 IP
  2. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #2
    javascript's window.location() is probably what you want. php is strictly server side. meaning that you can't control the browser via php. javascript on the other hand, is client side and has what you are looking for.
     
    ansi, Jun 16, 2007 IP
  3. InFloW

    InFloW Peon

    Messages:
    1,488
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Also keep in mind that javascript is a client side language so the user must have it enabled in their browser. So relying on it to do crucial functionality where you want every user to have this feature never works out to well.
     
    InFloW, Jun 16, 2007 IP
  4. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #4
    neolegionar, can you be a bit more specific? Seems all you want is a redirect:
    header('Location: http://example.com');
    PHP:
     
    krt, Jun 16, 2007 IP
  5. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #5
    ah well yeah that might be what he's looking for :)
     
    ansi, Jun 16, 2007 IP