Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jan 2006
    Location
    Preston, Lancashire, England
    Posts
    285
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calling php funciton and forgetting about it. how?

    Hello.

    I am making a predictor league so people enter predictions of Football matches and they get points depending of the results. When new matches are entered or when the results are tallied and the league tables worked out i have a script to email all the users their points/leagues or to let them know there are more predictions for them.

    The email script work great whhen there was 50 users but now there are 1000 it fails most of the time. Either the user closes the screen or it times out.

    I was wondcering does anyone know of a way i can get the php code to call another php file to run in the back ground so it will run until its finish and won't matter if the user closes the window.

    Cheers.

    p.s. i know i can call cron jobs in apache. but work is forcing me to use iis.

    Cheers again

    MRMAN

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,107
    Thanks
    2
    Thanked 326 Times in 318 Posts
    Look into using the Windows task scheduler to accomplish what a cron job would do.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #3
    Regular Coder
    Join Date
    Jan 2006
    Location
    Preston, Lancashire, England
    Posts
    285
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Cheers Pal,

    I have this

    PHP Code:
    exec("c:\php\php.exe c:\Inetpub\wwwroot\...\emailscript.php"); 
    however it still waits for the script to be finish. Do you know how to change it.

    CHeers

  • #4
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    well it will wait for the script to finish no matter what

  • #5
    Senior Coder
    Join Date
    Mar 2003
    Location
    Atlanta
    Posts
    1,037
    Thanks
    14
    Thanked 30 Times in 28 Posts
    Also, you could use ignore-user-abort() to keep the script running even when a user closes out a window. But as stated, the cron/windows scheduler is the best route.
    Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.

  • #6
    Regular Coder
    Join Date
    Jan 2006
    Location
    Preston, Lancashire, England
    Posts
    285
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Cheers Thank you for the info.

    I used a little pop up window that will call the script then close it self after a few second leaving the script running.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •