if(****)
header("Location:index.php");

解决方案 »

  1.   

    if(($result['userid']==$username)&&($result['password']==$password))
    {
    echo "welcom to  webside";
    echo "<br>";
    echo "<table>";
    echo "<tr><td>";
    echo "<a href=index.html?userid=".$username."'>";
    echo "主页";
    echo "</td></tr><table>";
    }
    else{
    echo "<script language=\"Javascript\">";
    echo "alert('the userid not correct,please checked it first');";
    echo "history.back(); ";
    echo "</script>";
    }
    ?>
    下面这种方法更直接
    if(($result['userid']==$username)&&($result['password']==$password))
    {
    echo "<script language=\"Javascript\">";
    echo "location.href='../index.html'";
    echo "</script>";
    }
    else{
    echo "<script language=\"Javascript\">";
    echo "alert('the userid not correct,please checked it first');";
    echo "history.back(); ";
    echo "</script>";
    }
    ?>
      

  2.   

    如果我有index.php,我想从index.php跳转到test.php,但我不想在跳转后地址栏显示为test.php,要求地址栏里显示的还是index.php,能实现吗?怎么实现?跪求!
      

  3.   

    那你可以在登陆成功后就不要跳专了啊,直接require(test.php);不久可以了吗?
      

  4.   

    原来如此,我刚接触PHP,很多东西都还不懂.
    多谢hahawen!
      

  5.   

    用header("location:index.php");
    如果单纯是刷新跳转(即非条件跳转)可以使用
    <meta http-equiv="refresh" content="60;url=http://xylegend.myrice.com">
    其中content定义跳转时间(秒),url定义跳转页面
      

  6.   

    我在index.php里使用require(admin.php)实现了跳转,可是使用当我使用admin.php里的一条语句时出现了问题,该语句如下:<a href=\"?action_admin=adduserinfo\"><font size=2>添加</font></a>地址栏里转到的是index.php?action_admin=adduserinfo而不是我想要的admin.php?action_admin=adduserinfo,也就是说它又跳回到了index.php页面上了,请问如何解决啊?
      

  7.   

    呵呵,搞定了,我强行在?action_admin=adduserinfo的前面加上了admin.php
      

  8.   

    <meta http-equiv="refresh" content="TIME;url=[http://]***.***">