PHP网站后台进不去。惆怅。
输入完账号密码 点击登录 就没反应了。 US:admin pw:admin888 后台密码。
有能力的大神帮个忙给看看呗 ,网上淘的码
/* ======= >>> KingCMS
* @License http://www.KingCMS.com/license/ *
* @Link http://www.KingCMS.com/ *
* @E-Mail KingCMS(a)Gmail.com *
* Copyright (c) KingCMS.com All Rights Reserved. *
* ================================================== */
//显示登录
//king_ajax_login
function king_ajax_login(){
/**
登录页面增加一个$act变量,做登录判断用。
*/
global $king;
$adminname=kc_post('adminname');
$adminpass=kc_post('adminpass');
$s='
';
$s.=kc_check(array(array('adminname',0,$king->lang->get('system/check/e0'),2,12),array('adminname',1,$king->lang->get('system/check/e1'))));
$s.='
$s.='
';
$s.=kc_check(array(array('adminpass',0,$king->lang->get('system/check/e0'),6,30)));
if($GLOBALS['ischeck']){
$s.=kc_check(array(array('adminpass',12,$king->lang->get('system/login/check'),!king_ajax_login_check($adminname,$adminpass))));
}
$s.='
//增加验证码
$verify=new KC_Verify_class;
$s.=$verify->Show();
//expire
$array_select=array(
0=>$king->lang->get('system/time/cookie'),
86400=>$king->lang->get('system/time/oneday'),
2592000=>$king->lang->get('system/time/jan'),
15768000=>$king->lang->get('system/time/halfyear'),
315360000=>$king->lang->get('system/time/forever'),
);
$s.='
'.kc_htm_select('expire',$array_select,86400).'
$but=kc_htm_a($king->lang->get('system/common/login'),"{CMD:'login',IS:1}");
$but.=''.$king->lang->get('system/common/close').'';
// $s.='';
if($GLOBALS['ischeck']){
$_sql="select adminlogin from %a_admin where adminname='".$king->db->escape($adminname)."';";
if($_res=$king->db->getRows_one($_sql)){
$_location=$_res['adminlogin'];
}
kc_ajax('','',0,"parent.location='{$_location}'");
}else{
kc_ajax($king->lang->get('system/login/title'),$s,$but,'',450,280);
kc_error($but);
}
} //!king_ajax_login
//验证管理员帐号
//king_ajax_login_check
function king_ajax_login_check($_name,$_pass){
global $king;
if(strlen($_pass)>0){
$_md5pass=md5($_pass);
$_sql="select adminname,adminlanguage,adminmode,adminskins from %a_admin where adminname='".$king->db->escape($_name)."' and adminpass='".$_md5pass."' and isdelete=0;";
if($_res=$king->db->getRows_one($_sql)){
header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"');
setcookie('KingCMS_Admin',$_res['adminname']."\t".md5($_res['adminname'].$_md5pass),(kc_post('expire') ? time() + (int) kc_post('expire') : 0),'/');
setcookie("language",$_res['adminlanguage'],time()+86400000,'/');
//写管理员登陆信息
$_array=array(
'admindate' =>time(),
'[admincount]'=>'admincount+1',
);
$king->db->update('%a_admin',$_array,"adminname='".$king->db->escape($_name)."'");
$king->log(1,$_name);
return True;
}else{
//写登陆错误log
$king->log(2,$_name);
return False;
}
}else{
return False;
}
} //!king_ajax_login_check
//显示登录
//king_ajax_about
function king_ajax_about(){
global $king;
$s='
$s.='
KingCMS for PHP '.$king->devname.'
';$s.='
Version: '.$king->version.'
';///'.$king->lang->get('system/login/about').'$s.='
Copyright © KingCMS.com
';$s.='
2004 - 2011
';$s.='
kc_ajax($king->lang->get('system/common/about').'..',$s,0,'',240,290);
} //!king_ajax_about
//退出登录
//king_ajax_logout
function king_ajax_logout(){
global $king;
$king->access(0);
$king->cache->del('system/admin/'.$king->admin['adminname']);
//写注销log
list($_name,$_pass)=isset($_COOKIE['KingCMS_Admin']) ? kc_explode("\t",$_COOKIE['KingCMS_Admin'],2):array(NULL,NULL);
$king->log(3,$_name);
header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"');
setcookie('KingCMS_Admin',$_name,-864000,'/');
kc_ajax('','',0,'parent.location=\'../system/login.php\'');
}
/* ------>>> KingCMS for PHP
function king_def(){
global $king;
$king->skin->setPath('system.login.htm');//设置为home模板
$tip=is_file('../INSTALL.php')?"
".$king->lang->get('system/error/install')." |
$king->skin->output($king->lang->get('system/login/title'),null,null,''.$tip);
}
?>
回复讨论(解决方案)
账号密码不正确!
账号密码不正确! 把关键的代码贴出来就可以了
自己慢慢调是吧
楼主代码貌似用的是Cookie保存, 建议楼主仔细修改代码 。
貌似也不是自己源程序。
上一篇: SQLSERVER聚集索引和主键的误区
下一篇: 重温sql 设计的基本三大范式