Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 延迟重定向以显示html页面一段时间_Php_Html_Redirect_Url Redirection - Fatal编程技术网

Php 延迟重定向以显示html页面一段时间

Php 延迟重定向以显示html页面一段时间,php,html,redirect,url-redirection,Php,Html,Redirect,Url Redirection,我有这个页面,它有一个php重定向到另一个网站。但是这也有一个html,在重定向之前要显示。可以在这里完成吗?我想延迟重定向几秒钟,显示html内容在页面重定向之前显示一段时间 <?php if($app_used=='Cnojhjkct') { $redirectTo=$respL."?status=".$status."&orderID=".$orderID."&transaefNo

我有这个页面,它有一个php重定向到另一个网站。但是这也有一个html,在重定向之前要显示。可以在这里完成吗?我想延迟重定向几秒钟,显示html内容在页面重定向之前显示一段时间

    <?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>

事务响应
事务响应
"/>
您的交易是!您的任何进一步通信的交易参考号是。

您不能使用HTTP位置重定向来延迟,因为一旦读取它就会重定向,
相反,您可以使用刷新重定向,即:

    header( "Refresh:5; url=$redirectTop", true, 303); 

“Location”标题重定向无法做到这一点,因为它在发送时立即生效,并且必须在任何内容之前发送(即,在重定向发生之前,您不能显示任何内容)

您最好的选择可能是刷新重定向。请参阅以下问题:


或者,您可以使用客户端脚本来管理它(例如Javascript)。这在理论上为您提供了最多的控制,但在某些浏览器上可能会被禁用。

重复的。您能告诉我这将做什么吗?是“5”延迟时间?还是引用数?@user3105409它将刷新延迟5秒,您可以根据需要更改它