how to terminate HTTP connection ?

Discussion in 'PHP' started by stats, Aug 30, 2009.

  1. #1
    i'm trying to write a script that will trigger other scripts on other sites

    something like this

    for ($i=0; $i<20; $i++) {
    file_get_content("http://www.myothersite.com/file$i.php");
    }
    PHP:
    however, those other scripts take a while to execute and i don't want my trigger script to wait that long. So i want to terminate the connection as soon as i receive a couple bits .

    In other words - basically what i need is just to make a call to those remote scripts and imediately terminate the connection and make the call to the next script

    any idea ?
     
    stats, Aug 30, 2009 IP
  2. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    #2
    header("Connection: close");
     
    crivion, Aug 30, 2009 IP
  3. stats

    stats Well-Known Member

    Messages:
    586
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    110
    #3
    i need to terminate the connection on the receiver's side not on the sender's side
     
    stats, Aug 30, 2009 IP