页面“ A”包含以下形式:
在PageA.php中:
<form class="form-sign" method="post" id='s' name="s" action="pageB.php"
<div class="form-group">
<p> Have a Discount code ? </p>
<input class="form-control" type="text" name="codeact" id="codeact" value="" placeholder=" Enter your code" required />
<span class="help-block"></span>
</div>
<br>
<a href="#test" data-toggle="modal">
<button class="btn btn-primary btn-block" name = "submit" type="submit"> Start </button>
</a>
</form>
如果输入的激活码正确,则会显示模态以指示计时器将启动。 通过在Modal中单击“确定”,将显示pageB.php。 我的模态:
div id="test" class="modal fade" role="dialog">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Notice</h4>
</div>
<div class="modal-body">
<div class="alert alert-danger">The timed test will now begin.
</div>
<div class="modal-footer">
<a href="pageB.php">
<button type="button" class="btn btn-danger">YES </button>
</a>
<button type="button" class="btn btn-default" data-dismiss="modal">No</button>
</div>
</div>
</div>
</div>
</div>
验证码:
$email = $_SESSION['email'];
$codeact = $_POST['codeact'];
$query = "SELECT codeactivation FROM user where email ='".$email."'";
$result = mysqli_query($conn, $query);
while ($row = mysqli_fetch_array($result)) {
$codeactivation=$row['codeactivation'];
}
if($codeactivation==$codeact)
{}
1-如果代码正确,如何显示我的模态?否则,模态将不会显示。 2. pageB.php如何从pageA.php获取变量?