?? index_bank.php
字號:
<?php
session_start();
if ($noice_if) {
echo "<script language=\"JavaScript\">";
echo " location.replace(\"noice.php\");"; // 自己修改網址
echo "</script>";
}
require("functions/class_mysql.php");
require("configs/Configs.php");
require("functions/func_common.php");
////////////////////////////////////////////玩家登錄///////////////////////////////////////////
//if(isset($_COOKIE["UserId"]) and isset($_COOKIE["CityId"]) and isset($_COOKIE["UserName"]) and $_COOKIE["UserId"]<>"" and $_COOKIE["CityId"]<>"" and $_COOKIE["UserName"]<>""){
//
// //判斷當前用戶COOKIE的IP與服務器的登錄IP是否一致,如果不相同,則清除COOKIE,重新登錄
//
// $query=$db->query("select * from player_info where `u_id`='".$_COOKIE['UserId']."'");
// $login_result=$db->fetch_array($query);
//
// if($login_result['login_ip']<>$_COOKIE['login_ip']){
// session_unregister("online");
// session_destroy();
// setcookie("UserId","",time()-$cookie_times,"/");
// setcookie("UserName","",time()-$cookie_times,"/");
// setcookie("NickName","",time()-$cookie_times,"/");
// setcookie("CityName","",time()-$cookie_times,"/");
// setcookie("CityId","",time()-$cookie_times,"/");
// setcookie("CityArea","",time()-$cookie_times,"/");
// $_COOKIE["UserId"]="";
// $_COOKIE["UserName"]="";
// $_COOKIE["NickName"]="";
// $_COOKIE["CityName"]="";
// $_COOKIE["CityId"]="";
// $_COOKIE["CityArea"]="";
// echomsg("","?");
// }
//}
////////////////////////////////////////////安全退出///////////////////////////////////////////
if($_GET["action"]=="safe_logout"){
//更新玩家users表的marker為0;
$db->query("update users set marker='0' where username='".$_COOKIE['UserName']."';");
//玩家點擊退出鏈接時,記錄下線狀態(tài)
$query=$db->query("update player_info set `online`='0',`login_time`='".time()."' where `u_id`='".$UserId."'");
$cookie_times=$_COOKIE["cookie_times"];
if($query){
session_unregister("online");
session_destroy();
setcookie("UserId","",time()-$cookie_times,"/");
setcookie("UserName","",time()-$cookie_times,"/");
setcookie("NickName","",time()-$cookie_times,"/");
setcookie("CityName","",time()-$cookie_times,"/");
setcookie("CityId","",time()-$cookie_times,"/");
setcookie("country","",time()-$cookie_times,"/");
setcookie("CityArea","",time()-$cookie_times,"/");
$_COOKIE["UserId"]="";
$_COOKIE["UserName"]="";
$_COOKIE["NickName"]="";
$_COOKIE["CityName"]="";
$_COOKIE["CityId"]="";
$_COOKIE["country"]="";
$_COOKIE["CityArea"]="";
}
// $_GET['forward']='http://sg.wanlala.com';
// $verify = md5('logout'.$_GET['forward']."kangwglovewxm");
// header('Location: http://sg.wanlala.com/bbs/api/passport.php?action=logout&forward='.$_GET['forward'].'&verify='.$verify);
echomsg("已安全退出成功!","../index.php");
}
//調查提交;
if ($_POST['vote_up']=="up") {
for ($i=0;$i<4;$i++)
{
//寫入表中;
$query=$db->query("update vote set num=(num+'1') where id='".$i."';");
}
echomsg("提交成功,感謝您對我們的支持!");
}
///////////////////////////////////////////////////////////////////////////////////////
//開始驗證登錄
if($_POST["action"]=="login"){
if ($noice_if) echomsg("系統(tǒng)進行維護,給你帶的不便,我們十分抱歉!","noice.php");
//判斷用戶名是否為空;
if (!$_POST['Username']) {
echomsg("請輸入用戶名!");
}
//判斷密碼是否為空;
if (!$_POST['Password']) {
echomsg("請輸入密碼!");
}
//判斷驗證碼是否為空;
if (!$_POST['code']) {
echomsg("請輸入驗證碼!");
}
//判斷驗證碼
if(strtolower($_POST['code'])<>$_SESSION['verifycode']) echomsg("驗證碼輸入錯誤!","../index.php");
/////////////////////////////////////判斷是否豆豆樂//////////////////////////////////////////////
$_POST['Username']=trim($_POST['Username']);
$username=strtolower($_POST['Username']);
if (! ereg("^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9\-\.])+", $username))
{
$password=substr(md5($_POST['Password']),0,16);
$query=$db->query("select * from users where `username`='".$username."' and `password`='".$password."'");
$m=$db->fetch_array($query);
}else{
$password=substr(md5($_POST['Password']),0,16);
$query=$db->query("select * from users where `username`='".$username."' and `password`='".$password."'");
if($row=$db->num_rows($query)){
$m=$db->fetch_array($query);}
else{
$key="$9KJDJ&^(239KJDJ";
$password=$_POST['Password'];
$password=md5($key.$password);
error_reporting(0);
include_once("is_file.php");
$str_url = 'http://www.doudoule.com/3guo/checklogin.jsp';
$exits = remote_file_exists($str_url);
//如果網通能打開
if($exits==true){
$fp = @fopen("http://www.doudoule.com/3guo/checklogin.jsp?username=".$username."&password=".$password,"r");
}
else{
$fp = @fopen("http://dx.doudoule.com/3guo/checklogin.jsp?username=".$username."&password=".$password,"r");
}
while($buffer=@fgets($fp)){
$value[]=$buffer;
}
foreach($value as $m){
$result.=$m;
}
if(strstr($result,"0")){
@fclose($fp);
@mysql_select_db("web3guo");
$password=substr(md5($_POST['Password']),0,16);
$db->query("INSERT INTO users (u_id,username,password,email,reg_time,reg_ip) VALUES (NULL,'".$username."','".$password."','".$username."','".time()."','".$_SERVER['REMOTE_ADDR']."')");
$query=$db->query("select * from users where `username`='".$username."' and `password`='".$password."'");
$m=$db->fetch_array($query);
}elseif(strstr($result,"2")){
@fclose($fp);
echomsg("E-mail輸入有誤");
}elseif(strstr($result,"1")){
@fclose($fp);
echomsg("密碼輸入有誤");
}else{
@fclose($fp);
echomsg("E-mail或密碼輸入有誤");
}
}
}
/////////////////////////////////////////////////////////////////////////////////
if($m["username"]==$username and $m["password"]==$password){/*驗證成功*/
//更新登錄IP
$db->query("update player_info set `login_ip`='".$_SERVER['REMOTE_ADDR']."',`login_time`='".time()."',`online`='1' where `u_id`='".$m["u_id"]."'");
//更新users表里的marker標記為1登陸狀態(tài);
$db->query("update users set marker='1' where username='".$_POST['Username']."';");
//獲取主城市ID
$query=$db->query("select c.c_area,c.c_area_x,c.c_area_y,c.c_id,c.c_name,p.p_country,p.p_nickname from city c,player_info p where c.`u_id`=p.`u_id` and p.`u_id`='".$m["u_id"]."' and `c_type`='1' order by c_id desc limit 1");
$c_id=$db->fetch_array($query);
$db->close();
//設置SESSION值
session_register("online");
$_SESSION['online']=$m["u_id"];
setcookie("cookie_times",$cookie_times,time()+$cookie_times,"/");
$_COOKIE["cookie_times"]=$cookie_times;
//設置COOKIE值
// if (!$c_id['c_id']) echomsg("用戶ID寫入不正確","?");
// if (!$m['u_id']) echomsg("用戶ID寫入不正確".$m['username'],"?");
// if ($c_id["c_id"]<'1') {
// echo "<SCRIPT language=JavaScript>";
// echo "top.window.location='game/init/create_role.php';";
// echo "</SCRIPT>";
// exit;
// }
//
$cookie_times=time()+$cookie_times;
setcookie("UserId",$m['u_id'],$cookie_times,"/");
setcookie("remember_UserName",$m['username'],$cookie_times,"/");
setcookie("UserName",$m['username'],$cookie_times,"/");
setcookie("NickName",$c_id['p_nickname'],$cookie_times,"/");
setcookie("CityId",$c_id['c_id'],$cookie_times,"/");
setcookie("CityArea",$c_id['c_area']."|".$c_id['c_area_x'],$cookie_times,"/");
setcookie("CityName",$c_id['c_name'],$cookie_times,"/");
setcookie("login_ip",$_SERVER['REMOTE_ADDR'],$cookie_times,"/");
setcookie("Country",$c_id['p_country'],$cookie_times,"/");
$_COOKIE["UserId"]=$m['u_id'];
$_COOKIE["CityId"]=$c_id['c_id'];
$_COOKIE["CityArea"]=$c_id['c_area']."|".$c_id['c_area_x'];
$_COOKIE["CityName"]=$c_id['c_name'];
$_COOKIE["NickName"]=$c_id['p_nickname'];
$_COOKIE["UserName"]=$m['username'];
$_COOKIE["login_ip"]=$_SERVER['REMOTE_ADDR'];
$_COOKIE["Country"]=$c_id['p_country'];
$_COOKIE["remember_UserName"]=$m['username'];
// echomsg($m['u_id'].'18'.$_COOKIE['UserId']);
//給元寶程序
include_once("give_cashmoney.php");
echo "<script>";
echo "top.window.location='interface/enter_game.php?action=enter_game&server=101&game_name=3guo'";
echo "</script>";
exit;
// 論壇接口//
// $action="login";
// $member = array
// (
// 'cookietime' => 86400,
// 'time' => time(),
// 'username' => $m["username"],
// 'password' => md5($_POST['Password']),
// 'email' => $m['email'],
// );
// $auth = passport_encrypt(passport_encode($member), "kangwglovewxm");
// if ($_GET['forward']=='') $_GET['forward']='../interface/enter_game.php?action=enter_game&server=101&game_name=3guo';
// $verify = md5($action.$auth.$_GET['forward']."kangwglovewxm");
// header('Location: http://sg.wanlala.com/bbs/api/passport.php?action=login&auth='.rawurlencode($auth).'&forward='.rawurlencode($_GET['forward']).'&verify='.$verify);
//////////////////////
}else{
echomsg("用戶名或密碼錯誤!","../index.php");
}
}
//引用頭首部內容;
include("top_end.php");
index_top();
?>
<SCRIPT language="JavaScript">
function refreshCc() {//驗證圖片更新
document.getElementById('imagecode').src = 'functions/passcode.inc.php?' + Math.random();
}
function check_login(obj)
{
if(obj.Username.value==""){
alert("請輸入用戶名!");
obj.Username.focus();
return false;
}
if(obj.Password.value==""){
alert("請輸入登錄密碼!");
obj.Password.focus();
return false;
}
if(obj.code.value==""){
alert("請輸入驗證碼!");
obj.code.focus();
return false;
}
login.style.display="none";
logining.style.display="";
}
<!--
//屏蔽js錯誤
function ResumeError() {
return true;
}
window.onerror = ResumeError;
// -->
</SCRIPT>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -