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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How To Make a PHP script Autorun?

    Hi all !

    I have recently bought a script which functions in the following manner:

    1. Searches for all the available items that are listed in a txt file.
    2. Buys them (by login into an account preloaded with funds) if they are available, else proceeds ahead without buying it (if unavailable , obviously!).

    The thing is that the nature of these items are such that they keep on coming at regular intervals and gets bought within a few minutes of their arrival, so I required a script that can grab them as soon as they are available. This would require the script to automatically run itself every 5-10 minutes to check their availability and purchase them using the account as soon as it traces them.

    The guy who wrote the script told me that there is some cron job in cpanel that can do it but he is not in good health these days and I have to wait for a few days till he fixes it. So, I thought it would be better, if I can try to fix it myself. But me being a complete noob in it require some help ! I will really appreciate if someone can help me out in this matter.

    Thanks in advance.

  • #2
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    timlinden.com/blog/website-development/php-cron-jobs-with-cpanel/

    From a quick Google search
    Useful function to retrieve difference in times
    The best PHP resource
    A good PHP FAQ
    PLEASE remember to wrap your code in [PHP] tags.
    PHP Code:
    // Replace this
    if(isset($_POST['submitButton']))
    // With this
    if(!empty($_POST))
    // Then check for values/forms. Some IE versions don't send the submit button 
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

  • #3
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,531
    Thanks
    8
    Thanked 1,091 Times in 1,082 Posts
    Sounds like a snipe script ...

    The best I can come up with is to use PHP CURL:
    http://www.catswhocode.com/blog/10-a...o-do-with-curl

    It's going to be a lot of scripting, testing, and hit-or-miss troubleshooting.

    You say you're a complete "noob", so I'm guessing you won't be doing it.
    I suppose you can hire a programmer though.

  • #4
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    Quote Originally Posted by mlseim View Post
    Sounds like a snipe script ...

    The best I can come up with is to use PHP CURL:
    http://www.catswhocode.com/blog/10-a...o-do-with-curl

    It's going to be a lot of scripting, testing, and hit-or-miss troubleshooting.

    You say you're a complete "noob", so I'm guessing you won't be doing it.
    I suppose you can hire a programmer though.
    He already has the script - just needs to add it to the crontab.
    Useful function to retrieve difference in times
    The best PHP resource
    A good PHP FAQ
    PLEASE remember to wrap your code in [PHP] tags.
    PHP Code:
    // Replace this
    if(isset($_POST['submitButton']))
    // With this
    if(!empty($_POST))
    // Then check for values/forms. Some IE versions don't send the submit button 
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.


  •  

    Tags for this Thread

    Posting Permissions

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