📄 createuser_php_md5.php
字号:
<html>
<head>
<title>Password Result</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p> </p>
<?php
$host="";
$uname="root";
$pass="";
$database="books";
$tablename="login";
$connect= mysql_connect($host,$uname,$pass)
or die("Database connection failed ! <br>");
$selectdb=mysql_select_db($database)
or die("Database could not be selected");
$sqlquery = "select customerid from login where customerid='".$customerid."'";echo $sqlquery . "\n<br>";$queryresult = mysql_query($sqlquery);
if($row=mysql_fetch_array($queryresult)){ die ("User already exists, please choose another name or customerid was not a number.");}/* MySQL's encode function.(to store encrypted passwords.) *//*$mingle= "encode('".$password."','".$password."')";
$sqlquery = "INSERT INTO login VALUES('". $customerid ."',".$mingle.")";
*//* PHP builtin MD5 function.(to store password hashes.) */
$sqlquery = "INSERT INTO login VALUES('". $customerid ."', '". md5($password) . "')";
$queryresult = mysql_query($sqlquery);
if (!$queryresult)
{
die(" Query could not be executed.<br>");
}
?>
<table width="330" border="0" align="center" cellpadding="5" cellspacing="2">
<tr>
<td colspan="2" bgcolor="#dddddd">
<div align="center"><b>New password entered for
<?php echo $customerid;
?>
` as </b></div>
</td>
</tr>
<tr bgcolor="#eeeeee">
<td width="50%">
<div align="right">Customer ID</div>
</td>
<td>
<center>
<?php echo $customerid; ?>
</center>
</td>
</tr>
<tr bgcolor="#eeeeee">
<td>
<div align="right">Password</div>
</td>
<td>
<center>
<?php echo $password; ?>
</center>
</td>
</tr>
<tr bgcolor="#eeeeee">
<td colspan="2"><center>Try your new password in the <a href="login.htm">login page</a></center></td>
</tr>
</table>
<p> </p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -