卷曲异步请求后表单提交和重定向回 [英] asynchronous curl request after form posted and redirected back

查看:123
本文介绍了卷曲异步请求后表单提交和重定向回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在提交和后数据保存到数据库后运行卷曲的权利。
当表单数据保存我运行卷曲并重定向到再次形成。

是否有可能无需等待卷曲完成重定向?
因为在我的情况下卷曲可能会采取更多的则一分钟。

问候。


解决方案

您可以利用一个 EXEC

 执行exec('PHP /path/to/your/curlscr​​ipt.php>的/ dev / null的2  - ;&放大器; 1安培;');

的/ dev / null的2 - ;&放大器; 1 &安培;不记录任何和> 后您的 curlscr​​ipt.php 意味着它不会等待任何东西。

I have to run curl right after submitting and saving post data into database. When the form data is saved i run curl and redirect to form again.

Is it possible to redirect without waiting for curl to complete? Because in my case curl may take more then a minute.

Regards.

解决方案

You could make use of an exec fork

exec('php /path/to/your/curlscript.php > /dev/null 2>&1 &'); 

The /dev/null 2>&1 & does not log anything and the > after your curlscript.php means it wont wait for anything.

这篇关于卷曲异步请求后表单提交和重定向回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆