|
数据库里有3个字段 name pass card,通过用户输入正确的name和card获得密码.
请达人们帮忙,谢谢了.
<?
include("lib.php");
$id = $_POST["id"];
$card = $_POST["card"];
$query = "select name,card from logindata where name='$id'and card='$card' limit 1";
$result = mysql_query($query);
if (mysql_num_rows($result)>0){
$userid = mysql_result($result,0,0);
$user_pass = mysql_result($result,0,1);
}
else
Error("用户名或身份证错误!");
if ($id == $userid and $card == $user_pass) {
$query = "SELECT `logindata` SET `pass` = '$pass' WHERE `name`='$id' limit 1";
$result = mysql_query($query);
if ($result) {
Error("取回密码成功,您的密码为:\\r$pass\\r请记住您的密码并妥善保管!");
}
}else{
Error("用户名或身份证错误!");
}
?> |
|