RUN PHPeven if the user close the browser windows

Discussion in 'PHP' started by redhits, Nov 4, 2007.

  1. #1
    I known there is a command that let me make my scripts run even if the user close the browser window.

    May i known it?! Because i can't remember it
     
    redhits, Nov 4, 2007 IP
  2. phper

    phper Active Member

    Messages:
    247
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Have a look at the functions exec() and pcntl_fork().
     
    phper, Nov 4, 2007 IP
  3. bobb1589

    bobb1589 Peon

    Messages:
    289
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #3
    no phper thats not what hes looking for... i know what hes talking about and i am just trying to recall what it is
     
    bobb1589, Nov 4, 2007 IP
  4. redhits

    redhits Notable Member

    Messages:
    3,023
    Likes Received:
    277
    Best Answers:
    0
    Trophy Points:
    255
    #4
    hey guys
    i found it out!

    ignore_user_abort(true);


    :)
     
    redhits, Nov 4, 2007 IP
  5. bobb1589

    bobb1589 Peon

    Messages:
    289
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #5
    ignore_user_abort(); is the function

    edit:

    posted too late haha... i used to have a function where you could set it like a cron ill see if i can find it


    edit 2:

    ignore_user_abort(); // run script in background
    set_time_limit(0); // run script forever
    $interval=60*15; // do every 15 minutes...
    do{
    // add the script that has to be ran every 15 minutes here
    // ...
    sleep($interval); // wait 15 minutes
    }while(true);
     
    bobb1589, Nov 4, 2007 IP
    redhits likes this.
  6. redhits

    redhits Notable Member

    Messages:
    3,023
    Likes Received:
    277
    Best Answers:
    0
    Trophy Points:
    255
    #6


    Thanks for your help , from were you from ? maybe we can do a cool team together :)
     
    redhits, Nov 4, 2007 IP
  7. bobb1589

    bobb1589 Peon

    Messages:
    289
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #7
    im from the US
     
    bobb1589, Nov 4, 2007 IP