各位大侠,我的错在哪里了,请指点 把php代码写到html代码前面应该就可以了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 正确的格式是这样的,要加空格。header("Location: x.php"); <HTML><HEAD><TITLE>自动跳转</TITLE></HEAD><BODY><?$today=date("w",time());switch ($today) {case "0": header("Location: 1.php");case "1": header("Location: 2.php");case "2": header("Location: 3.php");case "3": header("Location: 4.php");case "4": header("Location: 5.php");case "5": header("Location: 6.php");case "6": header("Location: 7.php");}?></BODY></HTML> 在每个“case” 结束后,都需要加 break; <HTML><HEAD><TITLE>自动跳转</TITLE></HEAD><BODY><?$today=date("w",time());switch ($today) {case "0": header("Location: 1.php"); break;case "1": header("Location: 2.php"); break;case "2": header("Location: 3.php"); break;case "3": header("Location: 4.php"); break;case "4": header("Location: 5.php"); break;case "5": header("Location: 6.php"); break;case "6": header("Location: 7.php"); break;}?> $today=date("w",time());switch ($today) {case "0": header("Location: 1.php"); break;case "1": header("Location: 2.php"); break;case "2": header("Location: 3.php"); break;case "3": header("Location: 4.php"); break;case "4": header("Location: 5.php"); break;case "5": header("Location: 6.php"); break;case "6": header("Location: 7.php"); break;} 跳转就跳转html就不用写了 把前面的html删掉,<? 之前不要有任何字符,包括空格回车。 呵呵。 你肯定没装PHP运行平台吧! 在发送header("location:1.php");前是不能有输出的 用这个<?phpfunction redirect($web,$time=0){ echo"<meta http-equiv=\"Refresh\" Content=\"".$time."; URL=$web \">"; echo"<meta http-equiv=\"Pragma\" Content=\"no-cache\">"; die();}//用这个$today=date("w",time());switch ($today) {case "0": redirect("1.php"); break;case "1": redirect("2.php"); break;case "2": redirect("3.php"); break;case "3": redirect("4.php"); break;case "4": redirect("5.php"); break;case "5": redirect("6.php"); break;case "6": redirect("7.php"); break;}?> 关于无限分类的数组问题 如何用Snoopy模拟“用户登录ASP.Net页面” 乱码,还是乱码!!!! session共用问题求助,急! 请教高手:PHP的调试问题(Zend Studio相关) 如何显示数据记录的序号(急,在线等) 请问如何转换\\为 \?谢谢! 一个关天聊天室的问题! 在win xp下怎么装php? php类中不同方法new同一个model 和 用单例模式去获取model实例的区别?? 求助PHP安装的问题 好久没来,散点分——公司要搞个BLOG
<HEAD>
<TITLE>自动跳转</TITLE>
</HEAD>
<BODY>
<?
$today=date("w",time());
switch ($today)
{
case "0":
header("Location: 1.php");
case "1":
header("Location: 2.php");
case "2":
header("Location: 3.php");
case "3":
header("Location: 4.php");
case "4":
header("Location: 5.php");
case "5":
header("Location: 6.php");
case "6":
header("Location: 7.php");
}
?>
</BODY>
</HTML>
<HEAD>
<TITLE>自动跳转</TITLE>
</HEAD>
<BODY>
<?
$today=date("w",time());
switch ($today)
{
case "0":
header("Location: 1.php");
break;
case "1":
header("Location: 2.php");
break;
case "2":
header("Location: 3.php");
break;
case "3":
header("Location: 4.php");
break;
case "4":
header("Location: 5.php");
break;
case "5":
header("Location: 6.php");
break;
case "6":
header("Location: 7.php");
break;
}
?>
switch ($today)
{
case "0":
header("Location: 1.php");
break;
case "1":
header("Location: 2.php");
break;
case "2":
header("Location: 3.php");
break;
case "3":
header("Location: 4.php");
break;
case "4":
header("Location: 5.php");
break;
case "5":
header("Location: 6.php");
break;
case "6":
header("Location: 7.php");
break;
}
html就不用写了
把前面的html删掉,<? 之前不要有任何字符,包括空格回车。
你肯定没装PHP运行平台吧!
header("location:1.php");
前是不能有输出的
function redirect($web,$time=0)
{
echo"<meta http-equiv=\"Refresh\" Content=\"".$time."; URL=$web \">";
echo"<meta http-equiv=\"Pragma\" Content=\"no-cache\">";
die();
}
//用这个$today=date("w",time());
switch ($today)
{
case "0":
redirect("1.php");
break;
case "1":
redirect("2.php");
break;
case "2":
redirect("3.php");
break;
case "3":
redirect("4.php");
break;
case "4":
redirect("5.php");
break;
case "5":
redirect("6.php");
break;
case "6":
redirect("7.php");
break;
}?>