【发布时间】:2015-06-29 12:32:08
【问题描述】:
为什么我的 Modal 不起作用?使用 POST 方法有错吗?当我加载页面并单击忘记密码的链接并最终显示模式时,然后当我输入我的电子邮件时没有任何反应。有人可以帮我吗?
这是我的 PHP 脚本。
<?php
require 'db.php';
$msg='';
if(isset($_POST['submit']))
{
$emailRet = mysqli_real_escape_string($connection, $_POST['emailRetrieve']);
$sql2 = mysqli_query($connection, "SELECT Email_Address, Password FROM pawnshop WHERE Email_Address='".$emailRet."'");
while ($row = mysqli_fetch_array($sql2, MYSQL_ASSOC)) {
$emailRetrieve = $row['Email_Address'];
$passwordRetrieve = $row['Password'];
}
$number = mysqli_num_rows($sql2);
echo $number;
if(mysqli_num_rows($sql2) < 1){
require 'smtp/Send_Mail.php';
$to = $emailRetrieve;
$subject = "PBMS Password Retrieval";
$body ='Hi, This is your account information<br><br> Username:'.$emailRetrieve.'<br> Password:'.$passwordRetrieve.'';
Send_Mail($to,$subject,$body);
$msg='Check your email to get your password';
echo 'send';
}
else
{
$msg='Check your email and try again';
}
}
?>
这是我的模态html代码
<html>
<head>
<link type='text/css' href='css/modal.css' rel='stylesheet' media='screen' />
<script type='text/javascript' src='js/jqueryModal.js'></script>
<script type='text/javascript' src='js/jquery.simplemodal.js'></script>
<script type='text/javascript' src='js/modal.js'></script>
</head>
<body>
<form method="post">
<div id='basic-modal'>
<center>
<a href='#' class='basic custom-font-reg'>Forgot password?</a><br>
<a href='Registration.php' class='custom-font-reg'>Register for an account?</a>
</center>
</div>
<hr class="hr-custom2">
<div id="basic-modal-content">
<div class="getPasswordWrapper">
<hr class="PasswordHeaderColor"></hr>
<p class="enterEmailPasswordText">Enter your username to get your password</p>
<center>
<input type="text" name="emailRetrieve" class="getPassword" placeholder="Your Username\Email" required/>
<button type="submit" class="getPasswordButton">Send</button>
<span><?php echo $msg; ?></span>
</center>
</div>
</div>
</form>
</body>
</html>
【问题讨论】:
标签: php html mysql modal-dialog