php header Location当前页面

来源:百度知道 编辑:UC知道 时间:2024/05/18 05:26:24
header("Location:当前页面");

怎么写

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

你输出
<?php
print_r($_SERVER);

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

绝对的就是$_SERVER[SCRIPT_FILENAME]

相对的就是$_SERVER[PHP_SELF]

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