在提交html表单上显示成功消息

问题描述 投票:0回答:1

我正在尝试在提交按钮上方显示成功消息,但它指示我进入表单页面。这是我正在尝试做的事情-

//form is on deck.html page
<div class="row footer-newsletter justify-content-center">
      <div class="col-lg-6">
        <form action="forms/subscribe.php" method="post">
          <input type="email" name="email" placeholder="Enter your Email"><input type="submit" value="Subscribe">
        </form>
      </div>

我正在通过电子邮件获取表单输入,因此以下代码在哪里出错

// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to,$email_subject, $email_message, $headers);  
?><!-- include your own success html here.
So i am getting form details to email but succes message below is appearing on /forms/subscribe.php 
where actually i am looking to display just above button   -->
Thank you for contacting us. We will be in touch with you very soon.
<?php

我尝试提交弹出窗口,警告框,但它总是使我订阅页面,并且我希望显示在订阅按钮之前Here is image

javascript jquery html forms
1个回答
0
投票

我们需要做的是:

© www.soinside.com 2019 - 2024. All rights reserved.