Opening a url

Discussion in 'PHP' started by joe_T, Mar 30, 2008.

  1. #1
    Hi
    this is a basic question :
    I wrote a simple php that executes a command on my server.
    When it's done, I want to automatically close this php page and open www.myURL.com.
    How do I do this?
    Thanks
    joe
     
    joe_T, Mar 30, 2008 IP
  2. Xtrm2Matt

    Xtrm2Matt Active Member

    Messages:
    129
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #2
    You could simply put header( "Location:http://www.YourURL.com" ); at the very end of the script.
     
    Xtrm2Matt, Mar 30, 2008 IP
  3. Morishani

    Morishani Peon

    Messages:
    239
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Well
    
    <?
    //Your PHP Code Here
    //You need to make sure that there is no output from the PHP code
    
    header("location:www.myURL.com");
    ?>
    
    HTML:
    Good luck :)
     
    Morishani, Mar 30, 2008 IP
  4. AdnanAhsan

    AdnanAhsan Well-Known Member

    Messages:
    601
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    110
    #4
    use header if you want to redirect...
     
    AdnanAhsan, Mar 30, 2008 IP
  5. joe_T

    joe_T Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thanks alot :)
     
    joe_T, Mar 30, 2008 IP