Jump to content

PHP is it capable of this??


l33t

Recommended Posts

Hi, iam abit of a nub at web site related stuff, iam however a advanced c programmer and i want to no before i decide to learn if php is capable of something iam gonna do. The thing is i want to upload a application on a web sever and i want it to run for a certain amount of time even while iam not on the site, it is  acolor reconizing program which i want to be able to browse a certain game... iam sure you no what iam getting at now. But is php capable of this? is the web server capable of running while no one is on the site just like a application on platform?  ??? i really need some help from a pro please.

Link to comment
Share on other sites

Ok iam sorry about my bad typing =p, was just doing it fast, and the program is not the problem its rather i can have the server run the program while iam not on the site running it manually thats all.

Link to comment
Share on other sites

remember that if a script or program exceeds your hosts limits, that can cuase trouble.  so its fine to simply run the script while are away from that domain, however youll need to limit how long it runs for, and how much CPU its taking up, most hosts have very strict limits on this

Link to comment
Share on other sites

I Don't No If This Helps But I Found This Bit Of Code

 

If you want to simulate a crontask you must call this script once and it will keep running
forever (during server uptime) in the background while "doing something"
every specified seconds (= $interval):


<?php
ignore_user_abort(); // run script in background
set_time_limit(0); // run script forever
$interval=60*15; // do every 15 minutes...
do{
   // add the script that has to be ran every 15 minutes here
   // ...
   sleep($interval); // wait 15 minutes
}while(true);
?> 

Link to comment
Share on other sites

Awesome, although i gotta get used to asigning the varibles with $ because the last few languages i did i assigned them differently :-\ and the functions look pretty advanced to. btw do the functions in php return values? :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.