php - 重置密码不起作用

标签 php html mysql

有人可以帮我修复重置电子邮件吗,因为当我尝试重置它时,我收到一条消息:

已发送包含进一步说明的电子邮件。

但我没有收到重置链接。这是重置文件

请检查一下并帮助我

<?php include('header.php')?>
<?php

if(isset($_POST['forgotpassword']))
{
if($_POST['emailz'] != '')
{
$exsistsUser = mysql_fetch_array(mysql_query("SELECT * FROM users where email='".$_POST['emailz']."'"));
if($exsistsUser['email']!='')
{
$chkresult = mysql_fetch_array(mysql_query("SELECT * FROM settings where name='contact_us_email'"));
	

$from = $chkresult['value'];  
 $mail_to = $_POST['emailz'].", ";
 $headers = 'From: '.$from;
 $headers = "From: " . strip_tags($from) . "\r\n";
 $headers .= "MIME-Version: 1.0\r\n";
 $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
 $message = '<html><body>';
 $message .= '<table width="526" border="0" cellspacing="0" cellpadding="15">';
 $message .= '<tr><td align="left" valign="top" style="border:1px dashed #393939;"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#F5F5F5">';
  $message .='<tr><td height="90" align="left" valign="middle"><div style="margin-left:15px;"><a href="'.SITE_URL.'"><img src="'.SITE_URL.'/images/reset-design-dark-top-bar_04.png" alt="reset" width="190" height="39" border="0" style="background-color: rgb(51, 51, 51);" /></a></div></td>
        </tr>';
  $message .="<tr>
          <td height='26' align='left' valign='middle' bgcolor='#393939' style='font-family:Arial, Helvetica, sans-serif; font-size:12px; font-weight:normal; text-decoration:none; color:#FFFFFF;'><div style='margin-left:15px;'>Hi <b>'".$exsistsUser['name']."'</b></div></td>";
$message .='</tr>
        <tr>
          <td height="15" align="left" valign="top"></td>
        </tr>';
$message .='<tr>
          <td align="left" valign="top" style="font-family:Arial, Helvetica, sans-serif; font-size:12px; font-weight:normal; text-decoration:none; color:#414141;"><div style="margin-left:15px; margin-right:15px;">
              <p>Thanks for registering at <a href="'.SITE_URL.'/" style="font-family:Arial, Helvetica, sans-serif; font-size:12px; font-weight:normal; text-decoration:underline; color:#00A8FF;">Reset</a>, the best social media productivity solution the web.</p>';
$message .='<p>Your details are as follows.</p>';
$message .="<p><b>User Name:</b> '".$exsistsUser['name']."'</p>";
$message .="<p><b>Email Address:</b> <span style='font-family:Arial, Helvetica, sans-serif; font-size:12px; font-weight:normal; text-decoration:underline; color:#00A8FF;'>'".$_POST['emailz']."'</span></p>";
$message .="<p><b>Password:</b> '".$exsistsUser['password']."'</p>";
$message .="<p>Please click this link to active your account</p>";
$message .="<p><a href='".SITE_URL."/confirmation.php?confirmUser=".$exsistsUserss['keyz']."'>confirm registration</a></p>";
$message .="<p><br/></p>";
$message .='<p>If you ever forget your password, you can request a new password with the Forgot Password link on the login form at <a href="'.SITE_URL.'" style="font-family:Arial, Helvetica, sans-serif; font-size:12px; font-weight:normal; text-decoration:underline; color:#00A8FF;">Reset</a> using the email address shown above.</p>
              <p>Thank you for using our service.</p>
              <p>Best regards,</p>
              <p>Customer Service.</p>
            </div></td>
        </tr>';
$message .='<tr>
          <td height="10" align="left" valign="top"></td>
        </tr>';
$message .='</table></td></tr></table>';
$message .= "</body></html>";
echo '<div class=" icon-tick success">An e-mail with further instructions has been sent. </div>';
}
else
{
header('Location:login.php');
echo '<div class=" icon-cross alertz"> Your log-in details were invalid. Please try again. </div>';
}
}
else
echo '<div class=" icon-cross alertz">This e-mail is not registered. </div>';
}
?>

最佳答案

你可以试试这个:

$body             = 'Please check your email and confirm the activation email to login. <br>';
$body             .= ($site['url'].'/tpl/mail/activate.email.php?activate='.$activationCode);

好吧,我不明白你为什么使用 file_get_contents 。如果您想发送链接,请将链接放在<a></a>中标签。

关于php - 重置密码不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32315482/

相关文章:

php - 如果目前实际上没有必要,是否愿意将大命令分解为较小的命令?

php - 上传大文件时显示内部服务器问题

javascript - 如何使用JS复制文本并粘贴到文本区域?

mysql - 在 MySQL 中获取 1 天、7 天和 30 天的计数

PHP:高级 ORDER BY

php - 匹配 url mysql

html - 透明度之谜 : iframe not transparent in Chrome&IE but Firefox

javascript - 使用 javascript 在标签中写入值

mysql在日期时间之间显示错误记录

database - mysql - 如何导入带有数字表名的数据库转储