thinkphp找回密码

这篇博客介绍了一种使用ThinkPHP框架实现找回密码的功能。通过一个简单的HTML表单,用户可以输入他们的用户名来开始找回密码的过程。表单提交后会调用`__URL__/findd`的ACTION,这通常是ThinkPHP中处理找回密码逻辑的控制器方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

public function f(){
  $this->display(findd);}
public function findd(){
$uname=$_REQUEST['username'];
$user=D('User');
$res=$user->where("username='$uname'")->find();
 if($res)
    {
    echo "用户名:".$res['username']."<br/>";
    echo "您丢失的密码为:".$res['password'];
    redirect('/wu_liuliu/index.php/Home/Denglu/show',1,"已找到密码,正在跳往登陆页面...");
    }
    else
    {
    $this->error('登录失败!若果您忘记密码,可以通过用户名','__URL__/findd');
    }

}


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>快乐LIFE</title>
  <style>
  #a{
width:414px;
height:427px;
position:absolute;
left: 435px;
top: 285px;
}
#b{
width:602px;
height:570px;
position:absolute;
left: 300px;
top: 42px;
background-image:url(/wu_liuliu/Public/images/b.jpg)
}
 #c{
width:414px;
height:427px;
position:absolute;
left: 410px;
top: 204px;
}
  </style>
</head>


<body><form action="__URL__/findd" method="post">
<div id="b"></div>
<div id="c">
  <div align="center"><h1><strong>快来找回密码吧!!!!</strong></h1></div>
</div>
<div id="a">


<table width="449" height="133" align="center">


  <tr>
    <td width="130">请输入用户名:</td>
    <td width="307"><input type="text" name="username"  /></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input type="submit" value="确定" /></td>
  </tr>
</table>
</div>
</form>


</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值