如何在php中重定向页面 [英] How to redirect a page in php

查看:104
本文介绍了如何在php中重定向页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须重定向网页中间的网页.但是,作为标头(位置:www.example.com")的条件,在此功能之前,不得将任何文本发送到浏览器.
但是我的要求是我必须根据真实或错误的情况在网页中间进行重定向.因此,我不能确保在header()调用之前可能没有文本.我如何才能做到这一点.

I have to redirect a web page in the middle of a webpage. But As, it is a condition for header("location: www.example.com") that no text should be sent to browser before this function.
But It is my requirement that I have to redirect in the middle of the web page based on a true or false condition. So, I cannot make sure that there may no text before the header() call. How can I make it possible.

推荐答案

您需要先弄清楚这一点,然后再将任何内容发送回客户端.

查看此链接以获取更多有关此的信息:
http://objectmix.com/php/417495-re -%5Bphp%5D-redirect-header-after-headers-sent.html [
You would need to figure that out before sending anything back to the client.

Check out this link for more on this:
http://objectmix.com/php/417495-re-%5Bphp%5D-redirect-header-after-headers-sent.html[^]

Good luck!


这篇关于如何在php中重定向页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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