【发布时间】:2013-06-24 12:45:42
【问题描述】:
我有问题,当用户单击忘记密码链接时如何将密码链接发送到用户电子邮件......
这里是 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>
任何建议都可以接受....
【问题讨论】:
-
具体是什么问题?您不知道如何创建链接?你不知道怎么发邮件?
-
@deceze 问题我不知道如何发送电子邮件...
-
只是一个有趣的阅读:stackoverflow.com/a/1069799/1063823