這是我從哪裏將數據發送到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);
}
?>
你的問題在哪裏?什麼不行?你嘗試了什麼? – VeNoMiS
更正了語法並對代碼進行了格式化 – Vega