forked from xserve98/xmweb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
101 lines (85 loc) · 2.97 KB
/
index.php
File metadata and controls
101 lines (85 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
session_start();
$_SESSION['SitePath'] = dirname(__FILE__);
include_once("include/mysqli.php");
include_once("include/config.php");
include_once("include/mobile_detect.php");
include_once("common/logintu.php");
include_once("common/function.php");
include_once("cache/conf.php");
include_once("cache/website.php");
/**
* 地区限制功能
*/
include_once("ip.php");
include_once("cache/dqxz.php");
$address = '='.iconv("GB2312","UTF-8",convertip($_SERVER["REMOTE_ADDR"])); //取出客户端IP所在城市
foreach($dqxz as $k=>$v){
if(strpos($address,$v)){
header("location:/");
exit;
}
}
function prefix_url(){
$s = !isset($_SERVER['HTTPS']) ? '' : ($_SERVER['HTTPS'] == 'on') ? 's' : '';
$protocol = strtolower($_SERVER['SERVER_PROTOCOL']);
$protocol = substr($protocol,0,strpos($protocol,'/')).$s.'://';
$port = ($_SERVER['SERVER_PORT']==80) ? '' : ':'.$_SERVER['SERVER_PORT'];
$server_name = isset($_SERVER['HTTP_HOST']) ? strtolower($_SERVER['HTTP_HOST']) : isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'].$port :
getenv('SERVER_NAME').$port;
return $server_name;
}
if(isset($_GET['f'])){
$uid= intval($_GET['f'])-100000;
$sql = "select uid from k_user where uid='$uid' and is_daili=1 limit 1";
$query = $mysqli->query($sql); //要是代理
$rs = $query->fetch_array();
if(intval($rs["uid"])){
setcookie('f',intval($rs["uid"]));
setcookie('tum',htmlEncode($_GET['f']));
$indexurl = "/register";
}
} else{
$arr = explode('.',prefix_url()); //用 . 号截取url分割
$f = $arr[0];
if($f!='www' && $f!='' && $f!='wap'){
$sql = "select uid from k_user where username='".htmlEncode($f)."' and is_daili=1 limit 1";
$query = $mysqli->query($sql); //要是代理
$rs = $query->fetch_array();
if(intval($rs["uid"])){
setcookie('f',intval($rs["uid"]));
setcookie('tum',htmlEncode($f));
$indexurl = "/register";
}
}
}
$detect = new Mobile_Detect;
?>
<?php include_once('myhome2.php') ?>
<!--script type="text/javascript">
var url = window.location.href;
if (url.indexOf("https") < 0) {
url = url.replace("http:", "https:");
window.location.replace(url);
}
</script-->
<script language="JavaScript">
</script>
<!--弹窗-->
<!--<script type="text/javascript">
layer.open({
type: 1,
title: '<?=$web_site['web_name']?> 官方网址:<?=$web_site['web_www']?>',
closeBtn: 1, //不显示关闭按钮
shade: [0],
area: ['600px', '400px'],
style:'background-color',
shade: [0.3, '#000'],
anim: 2,
content:'<div class="layerbox01" ><img src="<?=$web_site["web_ggtp"]?>" ondragstart="return false;"></div>',
});
</script>-->
</head>
<body >
</body>
</html>