Results 1 to 7 of 7

Thread: [RESOLVED] Auto - Executing a PHP Script every 24 hours?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2007
    Posts
    1,072

    Resolved [RESOLVED] Auto - Executing a PHP Script every 24 hours?

    Is it possible that I can make a script that will automatically execute every 24 hours?

  2. #2
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Auto - Executing a PHP Script every 24 hours?

    you are going to need to set a cron job for that.
    My usual boring signature: Something

  3. #3
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: Auto - Executing a PHP Script every 24 hours?

    Cronjobs are only available on UNIX servers. If your using a Windows server then you could use its scheduled tasks.

    It's also worth noting that free web hosts don't usually give you access to the crontab. Paid shared hosts might give you access to it via a web based control panel - so don't go looking for somewhere to type in crontab commands unless you have access to a shell on the server e.g. via SSH.
    Chris

  4. #4
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: Auto - Executing a PHP Script every 24 hours?

    Wanted to do this before (i know, guess sounds stupid)
    Run a script when the site is opened, see what is the time, and if it's time and the script you want to run were not executed yet (database value?), then run it.
    Can always run it with Ajax, so the user wont even know......
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

  5. #5
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Auto - Executing a PHP Script every 24 hours?

    the problem with that is that if no one goes to you site at the time that you specified, then the script wont be run at all.
    My usual boring signature: Something

  6. #6
    New Member jbaking's Avatar
    Join Date
    Oct 2008
    Location
    Philippines
    Posts
    9

    Red face Re: Auto - Executing a PHP Script every 24 hours?

    Quote Originally Posted by Zach_VB6
    Is it possible that I can make a script that will automatically execute every 24 hours?
    If you do regularly have your PC open, and you don't want to be bothered by manually visiting the page (PHP script) yourself, then create an invisible mini-app that has web browser controls (like in VB) that is set to visit that specific page at a specified time (probably with timer/threading control).

  7. #7
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Auto - Executing a PHP Script every 24 hours?

    Actually, my number is 865-5209
    My usual boring signature: Something

Posting Permissions

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



Click Here to Expand Forum to Full Width