这是一个自定义的函数:很好用
<?
//$URL 要跳转的连接
//$title 标题
//$content 描述
function jump_page($URL,$title,$content)
{
print <<<EOT        <html>        <head>        <style type="text/css">        <!--        a {color:#333333;font-size: 9pt;text-decoration:none; }        a:hover {color:#000066;text-decoration:underline overline;}        td{FONT-SIZE: 9pt; color:#333333; font-family:宋体}        -->        </style>        <title></title>        <meta http-equiv="Content-Type" content="text/html; charset=gb2312">        <meta HTTP-EQUIV=REFRESH CONTENT='5; URL=$URL'>        <script language="Javascript">                function Show(divid) {                divid.filters.revealTrans.apply();                divid.style.visibility = "visible";                divid.filters.revealTrans.play();        }        function Hide(divid) {                divid.filters.revealTrans.apply();                divid.style.visibility = "hidden";                divid.filters.revealTrans.play();        }        </script>        </head>        <body bgcolor="#e3e6e3" Onload="Show(msgboard)">        <div id="msgboard" style="FILTER: revealTrans(transition=23,duration=0.5) blendTrans(duration=0.5); position:absolute; left:300px; top:200px; width:300px; height:100px; z-index:1; visibility: hidden">            <table width="80%" border=0 cellspacing=0 cellpadding=6 bgcolor="#eeeeee" align=center>             <tr>              <td><b>$content</b></td>            </tr>          </table>        </div>        <script>        setTimeout('Hide(msgboard)',3000);        </script>        </body>        </html>EOT;exit;}jump_page('index.php','成功登录','<br>状态:用户成功登录!<br><ul><li><a href="index.php">返回首页</a></li></ul>');//这是用法
?>

解决方案 »

  1.   

    谢谢你
    可能是我表述的不太清楚,我是想不使用html标志和js,向知道php中有没有直接可以随时跳转的函数
      

  2.   

    <script>
    this.location.href = "test.php";
    </script>
      

  3.   

    当输出缓存(out buffering)打开时,
    用header就可以实现即时跳转。
      

  4.   

    用header("location:$url");
    不过在开始用
    ob_start()最后用
    end_flush();
      

  5.   

    header("location:$url");
    标准php用法
      

  6.   

    <script>
    this.location.href = "test.php";
    </script>
      

  7.   

    告诉你,php中没有你要的这样的函数!
    他们绕来绕去的不正面回答你的问题,还是我来直接回答吧.
    学PHP是不能完全避开js的,虽然你可以决定掺入js的多少.
      

  8.   

    用header()可以跳转。不过之能在页面的最前面,还是用js吧
      

  9.   

    sigh
    什么叫绕来绕去?
    asp里的重定向也是通过发送header来实现的,
    不过asp是默认打开输出缓存而已,所以可以实现即时跳转。
    php里,如果php.ini里设定了output_buffering = On
    再使用header("Location: sss.php");
    效果跟response.redirect 一样。cgi的标准就那样。
      

  10.   

    echo "script language=javascript> window.location='".$url.";</script>';
      

  11.   

    header("location:cwsd.51.net");
    这是标准php用法你试试/
      

  12.   

    搂主已经说过了,header()不算!!!!!!!!
      

  13.   

    使用JS跳转效果会更好!列如 <script> window.location.href="http://www.baidu.com";</script>