网站发送消息

时间:2016-06-15 11:31:53

标签: php html email post send

当我从我的网页发布消息时,它返回一个?在浏览器中,例如

我相信HTML和php都是正确的 html ......

`enter code here`     
<form class="form-horizontal">
                <fieldset>
                  <div class="form-group is-empty">
                    <label for="Name" class="col-md-2 control-     label">Name</label>
                    <div class="col-md-10">
                      <input type="text" class="form-control" id="Name" placeholder="Name">
                    </div>
                  </div>
                  <div class="form-group is-empty">
                    <label for="Email" class="col-md-2 control-label">Email</label>
                    <div class="col-md-10">
                      <input type="email" class="form-control" id="Email" placeholder="Email">
                    </div>
                  </div>
                  <div class="form-group is-empty">
                    <label for="Message" class="col-md-2 control-label">Message</label>
                    <div class="col-md-10">
                      <input type="text" class="form-control" id="Message" placeholder="Message">
                    </div>
                  </div>

                  <div class="form-group">
                  <form action="sendcontact.php" method="post">
                    <div class="col-md-10 col-md-offset-2">
                      <button type="submit">Send Message</button>
                    </div>
                  </div>

                </fieldset>
              </form>
            </div>
          </div>
        </div>
      </section>
enter code here

4 个答案:

答案 0 :(得分:0)

您已在表单标记中声明表单方法及其操作。如下所示

<form action="actionPage.php" method="POST"> //you can send data in get method or post method

希望这对你有用......

答案 1 :(得分:0)

行动=&#34; yourLoctionUrl&#34;告诉表单提交数据的位置。 如果你将它清空,那么它将显示你的输入字段和其他输入

答案 2 :(得分:0)

<form action="sendcontact.php" method="post" class="form-horizontal">
            <fieldset>
              <div class="form-group is-empty">
                <label for="Name" class="col-md-2 control-     label">Name</label>
                <div class="col-md-10">
                  <input type="text" class="form-control" id="Name" placeholder="Name">
                </div>
              </div>
              <div class="form-group is-empty">
                <label for="Email" class="col-md-2 control-label">Email</label>
                <div class="col-md-10">
                  <input type="email" class="form-control" id="Email" placeholder="Email">
                </div>
              </div>
              <div class="form-group is-empty">
                <label for="Message" class="col-md-2 control-label">Message</label>
                <div class="col-md-10">
                  <input type="text" class="form-control" id="Message" placeholder="Message">
                </div>
              </div>

              <div class="form-group">
            <div class="col-md-10 col-md-offset-2">
              <button type="submit">Send Message</button>
            </div>
          </div>

        </fieldset>
      </form>
    </div>
  </div>
</div>

您在编码中使用了两次表单标记。像我一样将actionpost放在开始表单标记中。

答案 3 :(得分:0)

您没有关闭第二个表单标记。去吧:

<form action="sendcontact.php" method="post">
  <div class="col-md-10 col-md-offset-2">
    <button type="submit">Send Message</button>
  </div>
</form>