FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Leaving a remote script running.





PatTheGreat42
Normally, when you acess a PHP file from a web browser, you send a request, and the script does its thing, and then sends an output.

However, is there any way to activate a script on a remote server, and just leave it running? Like, if you wanted (For example) a script that captured a webcam image from another site every five minutes, but just saved the files instead of sending them to you. Is this possible?
Traveller
PHP is not designed to run things like that, but for single runs. A cron job may be more appropriate, since cron's raison d'etre is to run tasks based on a particular schedule. Helios posted an excellent tutorial on how to use cron in the thread, http://www.frihost.com/forums/viewtopic.php?t=2621.

Also, please take note of the following advice from another thread:
Animal wrote:
They are active by default. However, please be careful when adding a CronJob. If it causes too much load on the server or it crashes, it will be removed.
afracsass
how about using iframe tag and javascript to run the remote php script.

just create a hidden iframe and target the iframe src as a url for window.open script method. U can call this script periodically using setInterval method.
Traveller
afracsass wrote:
how about using iframe tag and javascript to run the remote php script.

just create a hidden iframe and target the iframe src as a url for window.open script method. U can call this script periodically using setInterval method.
Would that not, then, require having a browser window on another computer set to that page at all times?
Related topics
PHP safety?
Domain question
Looking for easy FormMail Script
[OFFICIAL] World Of Warcraft - No new topics about this
Please help with cgiemail
PHP CLI
php include
php..free account help
Running a Perl script in the background
FTP and PHP
Server 2 Apache Down!?
Help in detect terminate script
the job of your dreams
Malicious script I can't seem to get rid of...
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.