<?php
include_once("inc/config.php");
include_once("inc/publicfun.php");
include_once("inc/ftbbsdbclass.php");
include_once("conn.php");
$bbsuser=ftbbs_request($_POST["bbsuser"]);
$answer=ftbbs_request($_POST["answer"]);
$bbsuser=str_replace("'","",$bbsuser);
$answer=str_replace("'","",$answer);
$sql="select * from {$tablepre}clubuser where clubuser_name='".$bbsuser."' and clubuser_answer='".md5($answer)."' and bbsmanager=0 and bbsadmin=0";
$rs=mysql_query($sql);
$row = mysql_fetch_array($rs);
$numrows = mysql_num_rows($rs);
mysql_free_result($rs);
if ($numrows==0){
   ftbbs_msg("用户名或问题答案不正确","userlogin.php");
}
else{
  $pwd=md5("123456");
  mysql_query("update {$tablepre}clubuser set clubuser_password='".$pwd."' where clubuser_name='".$bbsuser."' and clubuser_answer='".md5($answer)."'");
  ftbbs_msg("用户密码已被改成：123456","userlogin.php");
  $db->close(); 
}
?>