PHP reset password and send to email (full code)
The content of this article is about resetting the password in PHP and sending it to the email (complete code). It has a certain reference value. Now I share it with you. Friends in need can refer to it.
<span style="font-family:Microsoft YaHei;"><span style="font-size:14px;">public function sendpass() { $email=$_POST["email"]; $n=M("member"); $pass=substr(md5(time()), 0, 6); $where["password"]=md5($pass); $arr=$n->where("email='$email'")->find(); if($arr) { $id=$arr["id"]; if($n->where("id=$id")->save($where)) { $mail = new \Think\SendMail(); $mail->setServer("****.163.com", "****@163.com", "****"); //设置smtp服务器 $mail->setFrom("****@163.com"); //设置发件人 $mail->setReceiver($arr["email"]); //设置收件人,多个收件人,调用多次 $mail->setCc("****@163.com"); //设置抄送,多个抄送,调用多次 </span></span><span style="font-family:Microsoft YaHei;"><span style="font-size:14px;"> $mail->setMailInfo("****-密码重置", "密码:<b>$pass</b>"); //设置邮件主题,内容 $mail->sendMail(); //发送 $this->assign("rs","alert('重置密码成功,请查看邮箱!');"); $this->display("pages:login"); } else { $this->assign("rs","alert('重置密码错误!邮箱不存在!');"); $this->display("pages:login"); } } else { $this->assign("rs","alert('重置密码错误,邮箱不存在!');"); $this->display("pages:login"); } }</span></span>
Related Recommended:
The above is the detailed content of PHP reset password and send to email (full code). For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The top ten digital virtual currency apps are: 1. OKX, 2. Binance, 3. gate.io, 4. Coinbase, 5. Kraken, 6. Huobi, 7. KuCoin, 8. Bitfinex, 9. Bitstamp, 10. Poloniex. These exchanges are selected based on factors such as transaction volume, user experience and security, and all provide a variety of digital currency trading services and an efficient trading experience.

The top ten digital currency exchanges are: 1. OKX, 2. Binance, 3. gate.io, 4. Coinbase, 5. Kraken, 6. Huobi, 7. KuCoin, 8. Bitfinex, 9. Bitstamp, 10. Poloniex. These exchanges are selected based on factors such as transaction volume, user experience and security, and all provide a variety of digital currency trading services and an efficient trading experience.

The steps to register an Ouyi account are as follows: 1. Prepare a valid email or mobile phone number and stabilize the network. 2. Visit Ouyi’s official website. 3. Enter the registration page. 4. Select email or mobile phone number to register and fill in the information. 5. Obtain and fill in the verification code. 6. Agree to the user agreement. 7. Complete registration and log in, carry out KYC and set up security measures.

Can. The two exchanges can transfer coins to each other as long as they support the same currency and network. The steps include: 1. Obtain the collection address, 2. Initiate a withdrawal request, 3. Wait for confirmation. Notes: 1. Select the correct transfer network, 2. Check the address carefully, 3. Understand the handling fee, 4. Pay attention to the account time, 5. Confirm that the exchange supports this currency, 6. Pay attention to the minimum withdrawal amount.

The top ten digital currency exchanges are: 1. OKX, 2. Binance, 3. gate.io, 4. Coinbase, 5. Kraken, 6. Huobi, 7. KuCoin, 8. Bitfinex, 9. Bitstamp, 10. Poloniex. These exchanges are selected based on factors such as transaction volume, user experience and security, and all provide a variety of digital currency trading services and an efficient trading experience.

Registering a Sesame Door Account requires 7 steps: 1. Prepare a valid email or mobile phone number and a stable network; 2. Visit the official website; 3. Enter the registration page; 4. Select and fill in the registration method; 5. Obtain and fill in the verification code; 6. Agree to the user agreement; 7. Complete registration and log in, it is recommended to carry out KYC and set security measures.

To safely download the Binance APP, you need to go through the official channels: 1. Visit the Binance official website, 2. Find and click the APP download portal, 3. Choose to scan the QR code, app store, or directly download the APK file to download to ensure that the link and developer information are authentic, and enable two-factor verification to protect the security of the account.

The steps to register a Binance account include: 1. Prepare a valid email or mobile phone number and a stable network; 2. Visit Binance official website; 3. Enter the registration page; 4. Select the registration method; 5. Fill in the registration information; 6. Agree to the user agreement; 7. Complete verification; 8. Obtain and fill in the verification code; 9. Complete registration.
