【问题标题】:Web site send message网站发送消息
【发布时间】:2016-10-16 11:56:41
【问题描述】:

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

我相信 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

【问题讨论】:

  • &lt;form method="POST" action"page_with_php_to_process_the_form.php"&gt; 。如果在同一个页面处理表单,action标签可以为空:action=""
  • 你还没有定义要形成的动作和方法
  • 你的php代码在哪里?
  • like form action="actionPage.php" method="POST"

标签: php html email post send


【解决方案1】:

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

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

希望这对你有用...

【讨论】:

    【解决方案2】:

    action="yourLoctionUrl" 告诉表单在哪里提交数据。 如果您将其设置为空,那么它将显示?您的输入字段和其他输入

    【讨论】:

      【解决方案3】:
      <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 放在起始表单标签中。

      【讨论】:

        【解决方案4】:

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

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

        【讨论】:

          猜你喜欢
          • 2018-10-25
          • 1970-01-01
          • 2015-09-14
          • 1970-01-01
          • 2016-01-09
          • 2019-11-28
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多