把php代码写到html代码前面应该就可以了

解决方案 »

  1.   

    正确的格式是这样的,要加空格。header("Location: x.php");
      

  2.   

    <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>
      

  3.   

    在每个“case” 结束后,都需要加 break;
      

  4.   

    <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;
    }
    ?>
      

  5.   

    $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;
    }
      

  6.   

    跳转就跳转
    html就不用写了
      

  7.   


    把前面的html删掉,<?  之前不要有任何字符,包括空格回车。
      

  8.   

    呵呵。 
     你肯定没装PHP运行平台吧!
      

  9.   

    在发送
    header("location:1.php");
    前是不能有输出的
      

  10.   

    用这个<?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;
    }?>