表单操作和发布方法不起作用的PHP

时间:2018-06-28 00:40:36

标签: php html mysql html5 pdo

我有一个pay.php脚本,需要在输入金额后执行该脚本。但是文件pay.php无法加载。

html代码:

  <!DOCTYPE html>

  <body>

  <header class="header">
      <div class="bg-video">
         <video class="bg-video__content" autoplay muted loop >
            <source src="Pyramids - 1565.mp4" type="video/mp4">
            <source src="elephants-dream.webm" type="video/webm">
            Your browser is not supported!
         </video>
      </div>
</header>

</body>
</html>

当我分别加载pay.php文件时,我没有任何问题。  但是当我输入金额并单击“提交”时,表单操作无法运行或无法将数据插入数据库。

php代码:

<div class="sap_tabs">
                        <div id="horizontalTab" style="display: block; width: 100%; margin: 0px;">
                            <div class="pay-tabs">
                                <h2>Select Payment Method</h2>
                                  <ul class="resp-tabs-list">
                                      <li class="resp-tab-item" aria-controls="tab_item-0" role="tab"><span><label class="pic1"></label>Cash</span></li>
                                      <li class="resp-tab-item" aria-controls="tab_item-1" role="tab"><span><label class="pic3"></label>Cheque</span></li>
                                      <li class="resp-tab-item" aria-controls="tab_item-2" role="tab"><span><label class="pic4"></label>Mobile Money</span></li>
                                      <div class="clear"></div>
                                  </ul> 
                            </div>
                            <div class="resp-tabs-container">
                                <div class="tab-1 resp-tab-content" aria-labelledby="tab_item-0">
                                    <div class="payment-info">
                                        <h3>Details</h3>
                                        <form method ="post" action"pay.php">
                                            <div class="tab-for">               
                                                <h5>Amount</h5>                                                 
                                                    <input type="text" name = "amount" id ="amount" required />
                                            </div>
                                              <input type="submit" value="Submit" />                                                
                                        </form>

                                    </div>
                                </div>

1 个答案:

答案 0 :(得分:0)

<form method ="post" action"pay.php">

应该是

<form method ="post" action="pay.php">