将值返回给浏览器但仍在 PHP 中处理 [英] Return value to browser but still process in PHP

查看:59
本文介绍了将值返回给浏览器但仍在 PHP 中处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 flash 调用需要做一些处理的 PHP 页面.是否可以让 PHP 继续处理但仍然显示响应,以便 Flash 不会停止等待?

I am using flash to call a PHP page that needs to do a bit of processing. Is it possible to let PHP continue processing but show a response anyway so flash doesn't stall waiting?

推荐答案

我的回答来自这里:

您可以发送 Connection:Close 标头,为您的用户完成页面,但让你能够执行事情页面加载后".

You can send Connection:Close headers, which finishes the page for your user, but enables you to execute things "after page loads".

有一种简单的方法可以忽略用户中止(参见php手册):

There is a simple way to ignore user abort (see php manual too):

ignore_user_abort(true);

这篇关于将值返回给浏览器但仍在 PHP 中处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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