【发布时间】:2014-08-26 09:26:04
【问题描述】:
您好,我正在为我的学校项目制作一个电子邮件系统。我希望有人帮助让它在 html 文档部分中显示密码哈希。目前它没有显示任何内容。谢谢约书亚
<?php require_once 'application/config/autoload.php';
$host= DB_HOST;
$username= DB_USER;;
$password= DB_PASS;
$db_name= DB_NAME;
$tbl_name= DB_TABLE;
$user_name = Session::get('user_name');
error_reporting(0);
mysql_connect($host, $username, $password)or die("cannot connect");
mysql_select_db($db_name)or die("cannot select DB");
$sql = "SELECT user_id,
user_name,
user_email,
user_password_reset_hash,
user_perm_level,
user_type,
user_active,
user_failed_logins,
user_last_failed_login
FROM $tbl_name WHERE user_name='$user_name'";
$result = mysql_query($sql);
if($result){
$link = "$result->user_password_reset_hash";
echo "<html>
<head>
<style>
body {
background-color: #fff;
font-family: Arial;
font-size: 14px;
color: #000;
padding: 0;
margin: 15;
}
h1 {
font-size: 40px;
}
h2 {
font-size: 20px;
}
</style>
<div>
<img src='logo.min.png' align='left'></p>
<h1 align='right'>Teacher Help</h1>
<h2 align='right'>Verify Email<br></h2>
<p>$link</p>
</div>
</head>
</html>"; } ?>
【问题讨论】:
-
你可以很容易地用 MD5.js 用 jquery 做到这一点...
-
我说如果你想加密你的密码然后使用 md5.js...
标签: php html mysql database email