error_reporting(0);
header("Content-Type: text/html; charset=UTF-8");
$action=$_GET['action'];
session_start();
if(time() - $_SESSION['time'] >1800){
unset($_SESSION['username']);
unset($_SESSION['passcode']);
unset($_SESSION['userflag']);
unset($_SESSION['time']);
}
if(isset($_SESSION['username']))
{
if($action==appid){
$oldappid=$_POST['oldappid'];
$oldappsecret=$_POST['oldappsecret'];
$appid=$_POST['appid'];
$appsecret=$_POST['appsecret'];
$contents=file_get_contents('wx_config.php');
$contents= str_replace($oldappid,$appid,$contents);
$contents= str_replace($oldappsecret,$appsecret,$contents);
file_put_contents('wx_config.php',$contents);
exit( '
"修改成功!",
type: "success"
}, function() {location.href=document.referrer;});
});
');
}
if($action==user){
$user=$_POST['user'];
$password=md5($_POST['password']);
if($_POST['password']==''){
exit( '
"密码不能为空哦!",
type: "error"
}, function() {location.href=document.referrer;});
});
');
}
else{
$con = mysql_connect ('localhost','root','root');
@mysql_select_db('jianli', $con);
mysql_query("UPDATE `jianli`.`users` SET `username` = '$user' , `password`= '$password'");
exit( '
"修改成功!",
type: "success"
}, function() {location.href=document.referrer;;});
});
');}
}
}else{
exit( '
"抱歉,你还未登录哦!",
type: "error"
}, function() {location.href="login.php";});
});
');
}
?>
一键复制
编辑
Web IDE
原始数据
按行查看
历史