<script>
function redirect(){
  window.location.href='index.php';
}
window.setTimeout("redirect()",3000)
</script>

解决方案 »

  1.   

    你原来的代码是没有问题的,是不是content=\"3,url=index.php\"> 里面的都好不太对啊!我不太确定,但是你这种用法没有问题,我用过的。
      

  2.   

    帮我看看下面的代码在你们的机器上有没有我说的问题,我的有,谢谢<?
    if ( !IsSet($username) )
    {
    echo "<form action=$PHP_SELF method=post>
    <input name=username>
    <input type=submit>
    </form> ";
    }
    else
    {
    echo "<meta http-equiv=refresh content=\"3,url=$PHP_SELF\">";
    echo "your are $username";
    echo "<br>三秒后转向前页";
    }
    ?>
      

  3.   

    上面的代码改为下面的代码估计就OK了.$
    PHP_SELF在现在默认安装的新版本下已经不能使用了.
    <?php
    if (!isset($_POST["username"]))
    {
    echo "<form action=".basename($_SERVER["PHP_SELF"])." method=post>
    <input name=username>
    <input type=submit>
    </form> ";
    }
    else
    {
    echo "<meta http-equiv=refresh content=\"3,url=".basename($_SERVER["PHP_SELF"])."\">";
    echo "your are $username";
    echo "<br>三秒后转向前页";
    }
    ?>