Home > php教程 > php手册 > php header 跳转: PHP header跳转与return问题

php header 跳转: PHP header跳转与return问题

WBOY
Release: 2016-06-21 08:51:11
Original
1653 people have browsed it

调整了一个小时的程序,才发现有如此大的bug,以后用header跳转得注意了
使用header的跳转即“Location”,不能代替return
header只是向客户端发送原始的 HTTP 报头,即便是重定向,都不代表程序的终止。重定向后,程序仍然要执行完当前php文件,直到退出,你的页面虽然跳转,但后面的语句仍会对浏览器发生作用,特别是发生二次重定向的时候。
所以重定向后最好带上return
本文链接http://www.cxybl.com/html/wlbc/Php/20121019/33061.html



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template