时间:2021-07-01 10:21:17 帮助过:8人阅读
require_once("session.php"); $web_root_part = "../"; require_once($web_root_part."lib/db.php"); require_once($web_root_part."lib/function.php"); header('Content-type:text/html;charset=utf-8'); $AdminID = trim($_POST['AdminID']); $PassWord = trim($_POST['PassWord']); $Addtime = date("Y-m-d H:i:s"); $querySel = "select * from Admin where AdminID='".$AdminID."'"; if( !($result = $db->sql_query($querySel)) ) { message_die(DB_MESSAGE, 'Could not query Admin'); }else{ $row = $db->sql_fetchrow($result); //$db->sql_freeresult($result); if (empty($row['ID'])){ $sql="insert into Admin (AdminID,PassWord,Editer,Addtime) values('".$AdminID."','".md5($PassWord)."','".$_SESSION['AdminID']."','".$Addtime."')"; if( !($result = $db->sql_query($sql)) ) { //echo $sql; message_die(DB_MESSAGE, 'Could not query Admin'); }else{ echo ""; } }else{ echo ""; } } ?>