简体   繁体   English

是否可以在php标头之后不使用javascript来重定向页面?

[英]Is it possible to redirect a page without using javascript after php header?

I searched and didn't find an answer without javascript. 我搜索了没有javascript的答案。

I need to somehow redirect the user to other page without using javascript and after i already set the header... is it possible? 我需要以某种方式将用户重定向到其他页面而不使用javascript,并且在我已经设置了标题之后...这可能吗?

You can output a meta refresh . 您可以输出元刷新

<meta http-equiv="refresh" content="0; url=http://example.com/">

While it technically belongs only in the <head> , I tested several browsers and they all appear to process it even in the <body> . 尽管从技术上讲它仅属于<head> ,但我测试了几种浏览器,即使在<body> ,它们似乎都可以对其进行处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM