【问题标题】:in Bootstrap4- I need to submit Modal Form using php在 Bootstrap4- 我需要使用 php 提交模态表单
【发布时间】:2018-12-29 01:56:09
【问题描述】:

我正在为一家外卖餐厅构建这个website,客户要求提供 2 个模型,一个用于职业(接收简历),另一个用于订阅电子邮件更新。

如何让 MODEL 的表单将数据发送到 GET_POST 的 Php 页面?

我问这个的原因是我需要将所有模型数据记录到服务器的数据库中,而不仅仅是发送包含数据的电子邮件。

第一个模特@加入我们

<div class="modal" id="JoinModal">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">Subscribe for our updates</h5>
        <button class="close" data-dismiss="modal">&times;</button>
      </div>
      <div class="modal-body">
        <form action="addmail.php" method="post">
          <div class="form-group">
            <label for="username">Name</label>
            <input type="text" id="fname" placeholder="Name" class="form-control">
          </div>
          <div class="form-group">
            <label for="email">Email</label>
            <input type="email" id="email" placeholder="Email" class="form-control">
          </div>
        </form>
      </div>
      <div class="modal-footer">
        <button class="btn btn-success" value="Submit">Join</button>
      </div>
    </div>
  </div>
</div>

另一种接收简历的模式

<!-- Career MODAL -->
<div class="modal" id="CareerModal">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">Join our Team</h5>
        <button class="close" data-dismiss="modal">&times;</button>
      </div>
      <div class="modal-body">
        <form>
          <div class="form-group">
            <label for="username">Name</label>
            <input type="text" placeholder="Name" class="form-control">
          </div>
          <div class="form-group">
            <label for="familyname">Family Name</label>
            <input type="text" placeholder="Family Name" class="form-control">
          </div>
          <div class="form-group">
            <label for="email">Email</label>
            <input type="email" placeholder="Email" class="form-control">
          </div>
          <div class="form-group">
            <label for="cv">Attach your CV</label>
            <input type='file' name='cv' id='cv' class='form-control' ><br>
          <input type='button' class='btn btn-info' value='Upload' id='upload'>
          </div>
        </form>
      </div>
      <div class="modal-footer">
        <button class="btn btn-primary" value="Submit">Apply</button>
      </div>
    </div>
  </div>
</div>
</div>

【问题讨论】:

  • 您要求的内容太宽泛且不清楚。如果您还没有stackoverflow.com/help 和其中的相关链接,我认为现在是您浏览帮助区域的好时机。通读一遍,您将了解 Stack Overflow 上的工作原理。它会给你一个关于如何提出一个好问题的好主意,看看什么可以问,什么不应该问,以及对你的期望。这是为了帮助(您)在 Stack Overflow 上获得更好和积极的体验,这是每个人都想要和追求的目标。
  • 与其他形式类似。只需在该页面和方法中添加操作,然后在下一页使用 $_POST['name of the input'] 和 $_GET['name of input'] 并将名称属性添加到每个输入中,例如。使用这个formget.com/insert-data-in-database-using-php

标签: php html post model


【解决方案1】:

您可以使用 ajax 来帮助您执行并行操作 例如:插入数据库并发送邮件

希望对你有用

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-12-12
    • 1970-01-01
    • 1970-01-01
    • 2011-02-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多