executing remote php scripts consecutively
I have a couple php scripts on remote web servers and I'm not sure how to create a local script that will execute those remote scripts consecutively (a delay between each one of a few seconds would be fine) and then proceed with the execution of the local php script (which analyzes the information gathered by the remote scripts).
At the moment I use iframes just to run the remote scripts, but I'd prefer not to.
I'm assuming I can use javascript to do this, but while I can program PHP/MySQL with some success - I'm lost when it comes to javascript.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
You could use cURL in PHP. It will make an http request and wait for the result, then use sleep() to space out the executions.
http://us3.php.net/curl
If you know all URLs beforehead, you may use something like this:
with jQuery 1.5 http://api.jquery.com/jQuery.when
Depending on your OS and your server's OS, you could do something like this from cron:
You could also just run it directly on the server via cron:
Alternatively, you could use wget or curl to run the script via Apache/your-fav-web-server. Though, the above method has benefits such as easily getting an email of the script errors.
Perhaps give a little more info:
* remote server OS?
* server shell access?
* workstation/local server OS?
if you use jquery you can try something like