php header Location当前页面

header("Location:当前页面");怎么写
2025-03-12 09:44:11
推荐回答(3个)
回答1:

header("Location: t.html");
注意:":"后面要有一个空格,t.html页面就是当前页面

回答2:

你输出
print_r($_SERVER);

看一下就知道当前页面是哪个了!

绝对的就是$_SERVER[SCRIPT_FILENAME]

相对的就是$_SERVER[PHP_SELF]

回答3:

header("Location:".$_SERVER['PHP_SELF']);