header("Refresh: $time; URL=$url");
echo "<a href='$url'>操作成功!{$time}秒后返回</a>";

解决方案 »

  1.   

    <meta http-equiv="refresh" content="1;url=goodbye.htm; text/html; charset=gb2312">
    在你要跳转的地方加这一句content=1代表1秒
    url=xxxx代表要去的地方
      

  2.   

    但是我觉得header唯一不好的就是前面不能有输出,否则要出错!
      

  3.   

    例:
    a.php
    <?
    $sql=mysql_query("sql 语句") or die("sql 错误");
    ok_msg("信息添加成功","b.php");//ok_msg("您想提示的信息","将要跳转到的页面")function ok_msg($msg,$url='main.php'){
      echo '<table width="60%" border="0" cellpadding="5" cellspacing="1" bgcolor="#efebef">
             <tr> 
              <td align="center"><strong>信息提示</strong></td>
            </tr>
            <tr align="center"> 
              <td bgcolor="#FFFFFF">'.$msg.' <br> <br>
                请等待系统转向... <br> <br>
                (<a href='.$url.'>如果你不想等待请点击此处连接</a>) <br> <br></td>
            </tr>
            <tr> 
              <td>&nbsp;</td>
            </tr>
          </table>';
      exit();
    }?>根据自己的需要修改。
      

  4.   

    错了
    把上面的函数换成下面的
    function ok_msg($msg,$url='main.php')
    {
    echo '<html>
    <head>
    <title>准备转向...</title>
    <meta http-equiv="refresh" content="2; url='.$url.'">
    </head>
    <body bgcolor="#FFFFFF"><table cellpadding="0" cellspacing="0"border="0"width="100%" align="center" height="85%">
      <tr align="center" valign="middle">
        <td><table width="60%" border="0" cellpadding="5" cellspacing="1" bgcolor="#efebef">
    <tr> 
              <td align="center"><strong>&Igrave;á&Ecirc;&frac34;&ETH;&Aring;&Iuml;&cent;</strong></td>
            </tr>
            <tr align="center"> 
              <td bgcolor="#FFFFFF">'.$msg.' <br> <br>
                请等待系统转向... <br> <br>
                (<a href='.$url.'>如果你不想等待请点击此处连接</a>) <br> <br></td>
            </tr>
            <tr> 
              <td>&nbsp;</td>
            </tr>
          </table> </td>
      </tr>
    </table></body>
    </html>';
    exit();
    }