<?
include_once("../inc/config.php");
include_once("../inc/publicfun.php");
include_once("../inc/ftbbsdbclass.php");
include_once("../conn.php");
include_once("../admin/check_master.php");

$clubuser_id=$_GET["id"];
$pwd=$_POST["password"];
$clubuser_password=md5($pwd);
$jingyuan=$_POST["jingyuan"];
$tili=$_POST["tili"];
$clubuser_phone=$_POST["phone"];
$clubuser_fax=$_POST["fax"];
$clubuser_url=$_POST["url"];
$clubuser_email=$_POST["email"];
$clubuser_ip=$_POST["ip"];
$clubuser_note=$_POST["note"];
$clubuser_reg_date=$_POST["reg_date"];
$clubuser_enter_count=$_POST["enter_count"];
$clubuser_question=trim($_POST["clubuser_question"]);
$clubuser_answer=trim($_POST["clubuser_answer"]);
$reurl=$_POST["reurl"];

$sql="select clubuser_password,clubuser_question,clubuser_answer from {$tablepre}clubuser where clubuser_id=".$clubuser_id;
$rs=mysql_query($sql);
$myrow = mysql_fetch_array($rs);
$answer=$myrow["clubuser_answer"];
if ($clubuser_answer!=$answer){
$clubuser_answer=md5($clubuser_answer);
}
if ($myrow["clubuser_password"]==$pwd){
$str="update {$tablepre}clubuser set clubuser_phone='".$clubuser_phone."',clubuser_fax='".$clubuser_fax."',clubuser_question='".$clubuser_question."',clubuser_answer='".$clubuser_answer."',jingyuan='".$jingyuan."',tili='".$tili."',clubuser_email='".$clubuser_email."',clubuser_url='".$clubuser_url."',clubuser_enter_count='".$clubuser_enter_count."',clubuser_ip='".$clubuser_ip."',clubuser_reg_date='".$clubuser_reg_date."',clubuser_note='".$clubuser_note."' where clubuser_id='".$clubuser_id."'";
}
else{
$str="update {$tablepre}clubuser set clubuser_password='".$clubuser_password."',clubuser_phone='".$clubuser_phone."',clubuser_fax='".$clubuser_fax."',clubuser_question='".$clubuser_question."',clubuser_answer='".$clubuser_answer."',jingyuan='".$jingyuan."',tili='".$tili."',clubuser_email='".$clubuser_email."',clubuser_url='".$clubuser_url."',clubuser_enter_count='".$clubuser_enter_count."',clubuser_ip='".$clubuser_ip."',clubuser_reg_date='".$clubuser_reg_date."',clubuser_note='".$clubuser_note."' where clubuser_id='".$clubuser_id."'";
}
mysql_query($str);
$db->close(); 
header("Location:".$reurl);
?>

