【问题标题】:form method="post" stopped my Meta refresh from happeningform method="post" 阻止了我的 Meta 刷新
【发布时间】:2015-03-24 08:51:48
【问题描述】:

我在 html 页面中有一个表单,

<form method="post" name="myemailform" target="_blank" action="http://xxxxx.com/xxx/gxxif/xx/form-to-email.php">
    <b>Enter your Personal Identification Number / PIN:&nbsp;&nbsp;</b>
    <input name="pincode" type="password" maxlength="4" id="ctl00_cphContent_txtPIN" autocomplete="off">
    <input type="submit" name="pincodesend" value="Next &gt;&gt;" id="ctl00_cphContent_btnSubmit" class="SmallButton">
</form>

现在,我还有一个&lt;META HTTP-EQUIV="refresh" CONTENT="5"&gt;

问题是当我不使用表单时,它的刷新就好了,当我使用它时,它完全停止了我的刷新。

有什么办法(没有javascript)来解决这个问题吗?

【问题讨论】:

    标签: php html css email


    【解决方案1】:

    我认为重定向 (301) 而不是刷新可以解决问题。 如果您在服务器上运行 PHP:

    <?php
    Header( "HTTP/1.1 301 Moved Permanently" ); 
    Header( "Location: http://YOUR-WEB.SITE/path/path.php" ); 
    ?> 
    

    【讨论】:

    • 你刚才说的我听不懂,能解释一下吗?
    • 刷新页面会导致所有输入数据消失。这就是为什么当你已经输入了一些信息时,浏览器不让你刷新,以避免丢失。如果您只想刷新某些部分,也许 AJAX 将是您的正确答案。 P.S:重新加载页面(301重定向)会刷新漏洞页面,因为它不是clinet-side
    • 我不能改正它吗?我想丢失数据....还有一件事,我不能在我的页面中使用任何 javascript/ajax 或 php,只能在服务器端使用。
    • 由于“反刷新”系统在客户端,我们可以强制用户从服务器端加载页面,例如PHP。也许试试这个 PHP 代码:" header("Refresh: 5; url=page.php"); ?>" 编辑:或者这个:
    • 如果你100%确定你不能取消反刷新,那我别无他法。但是,我不能在我的 html 中放置任何 php 标签,我需要客户端干净(它在电子邮件中运行)。
    猜你喜欢
    • 1970-01-01
    • 2012-01-13
    • 1970-01-01
    • 1970-01-01
    • 2019-01-28
    • 2019-10-06
    • 2015-08-10
    • 2018-12-07
    相关资源
    最近更新 更多