【问题标题】:After submitting the form nothing is happening提交表单后什么都没有发生
【发布时间】:2019-04-16 05:06:49
【问题描述】:

这是我的代码,我想要“form-handler.php”代码,这样任何提交表单的人都应该将他们的详细信息发送到我的电子邮件地址代码是:

<!-- CONTACT FORM-->
<div class="wt-box">
    <form class="contact-form cons-contact-form" method="post" action="form-handler.php">
        <div class="contact-one p-a40 p-r150">
                    <div class="form-group">
                        <input name="username" type="text" required="" class="form-control" placeholder="Name">
                    </div>

                    <div class="form-group">
                        <input name="email" type="text" class="form-control" required="" placeholder="Email">
                    </div>

                    <div class="form-group">
                        <textarea name="message" rows="3" class="form-control " required="" placeholder="Message"></textarea>
                    </div>

                    <button name="submit" type="submit" value="Submit" class="site-button black radius-no text-uppercase">
                            <span class="font-12 letter-spacing-5">Submit</span>
                    </button>

【问题讨论】:

标签: php email


【解决方案1】:

下面是一个例子来说明如何做到这一点

<!DOCTYPE html>
<html>
<body>

<h2>Send e-mail to someone@example.com:</h2>

<form action="mailto:someone@example.com" method="post" enctype="text/plain">
Name:<br>
<input type="text" name="name"><br>
E-mail:<br>
<input type="text" name="mail"><br>
Comment:<br>
<input type="text" name="comment" size="50"><br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>

</body>
</html>

您需要标签&lt;form&gt; 并尝试使用&lt;input&gt; 而不是&lt;button&gt;

字体:https://www.w3schools.com/html/tryit.asp?filename=tryhtml_form_mail

:)

【讨论】:

  • 您错过了关于发送电子邮件的部分问题
  • &lt;br&gt;&lt;br&gt; — CSS 从 1996 年就出现了。我们不需要使用换行符来修改边距。
  • &lt;h2&gt;HTML Forms&lt;/h2&gt; - 为什么没有标题的副标题?
  • 总结一下:不要从 w3schools 复制/粘贴一些古老的、陈词滥调的废话,并期望得到积极的回应……抱歉 ;)
猜你喜欢
  • 1970-01-01
  • 2019-01-01
  • 1970-01-01
  • 2014-04-13
  • 1970-01-01
  • 2017-07-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多