I need to run a PHP script from another site, without the use of CRON, so that will be called whenever anyone comes or refreshes the page.
The script will perform some kind of update my database, it is possible that it takes several tens of seconds, so I needed to run the PHP script so that it also does not limit the site visitor, from where the script will be called.
But I do not want to make the script really starts up every time someone visits or refreshes the page, I would like to limit one minute and so, before calling the script, I would like to put into MySQL database current time someone (who is the one - the one who was first) arrives or refreshes the page, and in the case where someone just to update the page is first compares the current time with the database from the last call script, and if the difference is less than one minute, so the script does not call, but if more than one minute is executed while the database again writes the current time with the last script execution.
I do not need any response from running the script. Importantly, it shall not affect the page loading user, where it should be called.
Thanks for help
Ok, if javascript is not an option you can do a little bit more research on php forking. It's basically php version of Thread but much more limited. So you can actually fork a child php process to run in the background while the main process still doing the usual thing. So it won't affect your day to day process.
You could do a jQuery AJAX call in background after the page is load, so the user wont wait the script finish to load the page
http://api.jquery.com/jQuery.ajax/
However, I do not think the way you want to do it is correct. It's possible, but Im not sure if it's usefull.
Can you split your script in different tasks?? So you can do them before loading the page, and the users wont notice any difference.