我正在嘗試將 OTP 發(fā)送到某個電話號碼,該電話號碼是使用 PHP 從 mySQL 數據庫中獲取的。目前的工作方式:1.用戶輸入電子郵件并單擊登錄按鈕。2.隨機生成一個 OTP 并存儲在 DB 中。3.與檢索到的電子郵件關聯(lián)的電話號碼。但是,我使用的短信服務使用表單將數據提交給第三方發(fā)送文件。我的問題是我需要先檢索數據,然后使用該數據作為其他表單的參數并提交它。但我不知道是否可以只用一個按鈕來完成所有這些。下面是我調用登錄文件的表單。<form action="login.php" method="POST"> <div class="form-signin"> <h2 class="form-signin-heading"></h2> <?php if ($_REQUEST['s'] == 't') { ?> <label for="clientToken" class="sr-only">Verification Code</label> <input type="text" name="clientToken" id="clientToken" class="form-control" placeholder="6 digit Token" required autofocus><br> <?php } else { ?> <label for="clientEmail" class="sr-only">Email</label> <input type="text" autocomplete="clientEmail" name="clientEmail" id="clientEmail" class="form-control" placeholder="Email" required autofocus><br> <?php } ?> <input class="btn btn-lg btn-danger btn-block" type="submit" value="Login"></input><br> <?php if ($_REQUEST['s'] == 'f') { ?> <div class="text-center text-white">No such email exists in our records</div> <?php } ?> </div></form>有什么辦法可以讓我完成這項工作嗎?或者我需要兩個單獨的按鈕?
有沒有辦法提交一個表格,然后再為我提交另一個表格?
慕無忌1623718
2023-09-15 17:08:18