【发布时间】:2017-09-02 15:29:19
【问题描述】:
这是我的页面,我想从该页面将数据发送到dashboard/fpass.php 页面,并在成功后显示模式。
<script>
$(document).ready(function () {
$('#fmodal').click(function () {
$.ajax({
type: "POST",
url: "dashboard/fpass.php",
data: { name: "fpass" }
})
success: function(data) {
$("#myModal").modal();
}
});
});
</script>
这是我想要获取数据并发送邮件的下一页。
<?php
if(($_POST['name'])=='fpass')
{
/*add sql connection*/
require('../includes/dbconfig.php');
/*get the image file name from the table*/
$sql="select * from admin";
$res=mysqli_query($con,$sql);
$row=mysqli_fetch_array($res);
$email=$row['email'];
$password=$row['password'];
$bemail=$row['bemail'];
$sub="dashboard login password is < ".$password." >";
/*send mail to the sql entry*/
mail($email,"Forget Password Request",$sub,$bemail);
}
?>
【问题讨论】:
-
你的问题在哪里?什么不起作用?你尝试了什么?
-
更正语法并格式化代码