Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-10-2012, 01:22 PM   PM User | #1
majaal
New to the CF scene

 
Join Date: Jan 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
majaal is an unknown quantity at this point
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.
majaal is offline   Reply With Quote
Old 01-10-2012, 01:46 PM   PM User | #2
BluePanther
Senior Coder

 
Join Date: Jul 2011
Posts: 1,226
Thanks: 3
Thanked 171 Times in 171 Posts
BluePanther is on a distinguished road
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 
Quote:
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
BluePanther is offline   Reply With Quote
Old 01-10-2012, 01:51 PM   PM User | #3
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,045
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
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.
mlseim is offline   Reply With Quote
Old 01-10-2012, 01:55 PM   PM User | #4
BluePanther
Senior Coder

 
Join Date: Jul 2011
Posts: 1,226
Thanks: 3
Thanked 171 Times in 171 Posts
BluePanther is on a distinguished road
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 
Quote:
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
BluePanther is offline   Reply With Quote
Reply

Bookmarks

Tags
autorun php, php script

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:20 AM.


Advertisement
Log in to turn off these ads.