Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.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/7/user-interface/2.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
Html 显示信息后重定向_Html_User Interface_Redirect_Header - Fatal编程技术网

Html 显示信息后重定向

Html 显示信息后重定向,html,user-interface,redirect,header,Html,User Interface,Redirect,Header,假设用户提交反馈,然后我想将他们重定向到另一个位置。可以执行以下操作吗 header("Refresh: 4; url=$location"); header("Connection: close"); echo " Feedback successfully submitted. <hr /> "; 重定向前是否有其他方式显示信息?我应该用吗我想你是指这样的东西 在我看来,你做对了,只要使用 <p>Thank you for sub

假设用户提交反馈,然后我想将他们重定向到另一个位置。可以执行以下操作吗

header("Refresh: 4; url=$location");
header("Connection: close");

echo
    "
    Feedback successfully submitted.

    <hr />
    ";

重定向前是否有其他方式显示信息?我应该用吗我想你是指这样的东西

在我看来,你做对了,只要使用

<p>Thank you for submitting. If you're not redirected in 5 seconds, click <a href="redirect.php">here</a> </p>

<?php header( "refresh:5;url=redirect.php");  ?>

为什么在提交之前要显示信息?为什么不事后呢?标题'Location:youpage.php';可以将您重定向到其他页面。如果您需要在提交前显示信息,则必须根据需要使用jquery或ajax。它在提交后显示信息,但在重定向到其他页面之前显示信息。所以,没有javascript就不可能做这样的事情?哦。。我的错。。。是的,你可以做这样的事情:太好了……它看起来确实有效。我只是希望这不会有任何安全问题。我不这么认为,但我不是一个真正的安全专家。也许用谷歌搜索一下。