douaoj0994 2013-12-19 10:24
浏览 107
已采纳

延迟重定向以显示某个时间段的html页面

I have this page,it has a php which redirect to another website.But this has an html as well which is to be shown before the redirect.Can it be done here?I want to delay the redirection for a couple of seconds show that the html content is shown for some time before the page is redirected.

    <?php
            if($app_used=='Cnojhjkct')
            {
                $redirectTo=$respL."?status=".$status."&orderID=".$orderID."&transaefNo=".$cusf_no."&payMode=".$tranype."&cardider=".$cardPrider;
                header("Location: $redirectTo");
            }
    ?>


<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A layout example with a side menu that hides on mobile, just like the Pure website.">

<title>Transaction Response</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.3.0/pure-min.css">
<link rel="stylesheet" href="./main.css">
</head>
<body>
<div id="layout">
    <div id="main">
           <div class="header">
             <div class="pure-g-r">
        <div class="pure-u-1-4">
         <img src="./gsggd.png" alt="Peyto Lake">
         </div></div>
           <h1>Transaction Response</h1> 
        </div>
       <div class="content">            
            </div>
                  <div style="width:100%">
       <div style="margin-left:5%;width:5%;float:left;margin-right:20%;"><img src="<?php
if($message == 'successfull')
{
    echo './success.png';
}
else
{
    echo './failed.png';
}
?>"/></div>
       <div style="width:70%;float:left;"><h3>Your transaction was <?php echo $message; ?> ! Your transaction reference number for any further communication is <?php echo $cust_ref_no; ?> .</h3></div>
   </div>
   </div>
   </div>     
    </div>
</div>
</body>
</html>
  • 写回答

2条回答 默认 最新

  • duanjianhe1388 2013-12-19 10:26
    关注

    You can not use HTTP location redirect to delay, because as soon as it is read it redirects,
    instead you can use refresh redirect which is :

        header( "Refresh:5; url=$redirectTop", true, 303); 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?