How to keep the script running?

Discussion in 'PHP' started by shubhamjain, Feb 26, 2010.

  1. #1
    A script stops working as soon as the user closes the window. I want it to keep running even then until the assigned job is finished. Is it posssible?
     
    shubhamjain, Feb 26, 2010 IP
  2. HostingProvider

    HostingProvider Active Member

    Messages:
    1,480
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    95
    #2
    Of course it is:
    ignore_user_abort(true);
    PHP:
    Hope that helps! :)
     
    HostingProvider, Feb 26, 2010 IP
  3. leray

    leray Greenhorn

    Messages:
    39
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    20
    #3
    yes, ignore_user_abort(true); should help,but don't forget about max_execution_time (30s by default)
     
    leray, Feb 26, 2010 IP
  4. shubhamjain

    shubhamjain Active Member

    Messages:
    215
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    63
    #4
    I think there is a function to alter it[set_time_limit()];
     
    shubhamjain, Feb 27, 2010 IP