PHP网站后台进不去。惆怅。
http://www.xmfoodcn.com/system/login.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.='lang->get('system/common/close').'" class="k_close">'.$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,'<script>$.kc_ajax(\'{CMD:\\\'login\\\',METHOD:\\\'GET\\\'}\')</script>'.$tip);
}
?>
回复讨论(解决方案)
账号密码不正确!
账号密码不正确! 把关键的代码贴出来就可以了
自己慢慢调是吧
楼主代码貌似用的是Cookie保存, 建议楼主仔细修改代码 。
貌似也不是自己源程序。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Alipay PHP...

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

Article discusses essential security features in frameworks to protect against vulnerabilities, including input validation, authentication, and regular updates.

Sending JSON data using PHP's cURL library In PHP development, it is often necessary to interact with external APIs. One of the common ways is to use cURL library to send POST�...

The article discusses adding custom functionality to frameworks, focusing on understanding architecture, identifying extension points, and best practices for integration and debugging.

The application of SOLID principle in PHP development includes: 1. Single responsibility principle (SRP): Each class is responsible for only one function. 2. Open and close principle (OCP): Changes are achieved through extension rather than modification. 3. Lisch's Substitution Principle (LSP): Subclasses can replace base classes without affecting program accuracy. 4. Interface isolation principle (ISP): Use fine-grained interfaces to avoid dependencies and unused methods. 5. Dependency inversion principle (DIP): High and low-level modules rely on abstraction and are implemented through dependency injection.

Session hijacking can be achieved through the following steps: 1. Obtain the session ID, 2. Use the session ID, 3. Keep the session active. The methods to prevent session hijacking in PHP include: 1. Use the session_regenerate_id() function to regenerate the session ID, 2. Store session data through the database, 3. Ensure that all session data is transmitted through HTTPS.
