duanmei1350 2014-04-05 17:04
浏览 39
已采纳

PHP不会重定向到特定页面

I tried sleep() function and redirecting by meta tags. I have the following code. What do i do wrong?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Please wait... Generating reports...</title>
<link rel="SHORTCUT ICON" href="images/log.png">
</head>

<body>
<center>
<div style="margin-top:200px;">
<embed src="images/loadingcircle2.swf" width="30" height="30"></embed><br />
<i style="font-family:Tahoma, Geneva, sans-serif; color:#004e49; font-size:12px;">Generating the results. Please wait...</i>
<?php
header( "refresh:5; url=results.php" ); 
?>
</div>
</center>
</body>
</html>
  • 写回答

4条回答 默认 最新

  • doucuo4413 2014-04-05 17:13
    关注

    If you want to redirect after 5 seconds, you can do something like this:

     <div>
        Please wait... Generating reports..
     </div>
    
     <script type="text/javascript">
      setTimeout(function(){
          window.location.href = "result.php";
      },5000);
     </script>
    

    Hope this helps.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?