我有问题,当用户单击忘记密码链接时,如何向用户电子邮件发送密码链接....
这是 ForgetPasswordViewController.php ......我开发这个只是为了显示一个警报......但是当实时......我不知道如何发送密码链接......到用户电子邮件......
<?php
header("Cache-Control: private, must-revalidate, max-age=0");
header("Pragma: no-cache");
header("Expires: Fri, 4 Jun 2010 12:00:00 GMT");
//如果没有提交表单 HTML 会直接显示
if (!isset($_POST['submit']))
{
?>
<html>
<body>
<form name='f1' method="POST" action="" onSubmit="return ValidateEmail();">
<div id="fp">
<span style="margin-left:-50px">Email:</span>
<span><input class="input" type="text" name="Email" placeholder="Enter mailID" required></span><br>
<input style="height:50px; width:120px; background:url(Images/submit_butto.gif) no-repeat right top; border: none;" type="submit" name="submit" value="">
<?PHP
}
else
{
$Email=$_POST['Email'];
if(!empty($Email))
{
$model = new UsersModel();
$rowsCount = $model->checkUserEmail($Email);
echo $rowsCount;
if ($rowsCount!=0)
{
//If you are submitting the form insert the details into database
echo '<script type="text/javascript">alert("A password hasbeen sent to your Email..");
window.location.href="LoginViewController.php";</script>';
}
else
{
echo'<script type="text/javascript">alert("Enter valid email");
window.location.href="ForgetPasswordViewController.php";</script>';
}
}
}
?>
</body>
</html>
任何建议都可以接受......