You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
191 lines
4.8 KiB
191 lines
4.8 KiB
<?php |
|
|
|
$login=empty($_COOKIE['login']) ? 0:1; |
|
|
|
if($login==0){echo '<script>window.location.href="/404.php";</script>';} |
|
|
|
$port=$_COOKIE['port']; |
|
|
|
$conn=database_cnnct(); |
|
|
|
$row=sql_data($conn,'ssr','port',$port); |
|
|
|
$passwd=$row['passwd']; |
|
|
|
$str=base64_encode("aes-256-cfb:$passwd@usa.ssr.yimian.xyz:$port")." |
|
ss://".base64_encode("aes-256-cfb:$passwd@aus.ssr.yimian.xyz:$port")." |
|
ss://".base64_encode("aes-256-cfb:$passwd@ssr.yimian.xyz:$port"); |
|
|
|
?> |
|
|
|
|
|
|
|
|
|
<?php //declear function |
|
|
|
|
|
//fnct of get usr ip::()::(ip) |
|
function getip() |
|
{ |
|
if (getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown")) |
|
{ |
|
$ip = getenv("HTTP_CLIENT_IP"); |
|
} |
|
else |
|
if (getenv("HTTP_X_FORWARDED_FOR") && strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown")) |
|
{ |
|
$ip = getenv("HTTP_X_FORWARDED_FOR"); |
|
} |
|
else |
|
if (getenv("REMOTE_ADDR") && strcasecmp(getenv("REMOTE_ADDR"), "unknown")) |
|
{ |
|
$ip = getenv("REMOTE_ADDR"); |
|
} |
|
else |
|
if (isset ($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], "unknown")) |
|
{ |
|
$ip = $_SERVER['REMOTE_ADDR']; |
|
} |
|
else |
|
{ |
|
$ip = "unknown"; |
|
} |
|
return ($ip); |
|
} |
|
|
|
|
|
//fnct of connecting database::()::(database conn) |
|
function database_cnnct () |
|
{ |
|
$servername = "114.116.65.152"; |
|
$username = "yimian"; |
|
$password = "Lymian0904@112"; |
|
$dbname = "yimian"; |
|
|
|
// 创建连接 |
|
$conn = new mysqli($servername, $username, $password, $dbname); |
|
// Check connection |
|
|
|
|
|
if ($conn->connect_error) |
|
{ |
|
die("连接失败: " . $conn->connect_error); |
|
} |
|
|
|
return ($conn); |
|
} |
|
|
|
|
|
//fnct of get table row number::(data_cnnct var,table name) ::(row number) |
|
function sql_rowNum($conn,$tableSql) |
|
{ |
|
$row_count = $conn->query("SELECT COUNT(*) FROM $tableSql"); |
|
list($row_num) = $row_count->fetch_row(); |
|
return ($row_num); |
|
} |
|
|
|
//fnct of getting row data from database::(data_cnnct var, table name,column name, column value)::(row info) |
|
function sql_data($conn,$table,$clmnName,$value) |
|
{ |
|
$sql = "SELECT * FROM $table where $clmnName=$value"; |
|
|
|
$result = $conn->query($sql); |
|
///禁止非法访问 |
|
if ($result->num_rows > 0) {}else{echo "<script>alert('Illegal Visit!');setTimeout(function(){top.location='/404.php';},0)</script>";} |
|
|
|
$row = $result->fetch_assoc(); |
|
|
|
return ($row); |
|
|
|
} |
|
|
|
function array_orderby() |
|
{ |
|
$args = func_get_args(); |
|
$data = array_shift($args); |
|
foreach ($args as $n => $field) { |
|
if (is_string($field)) { |
|
$tmp = array(); |
|
foreach ($data as $key => $row) |
|
$tmp[$key] = $row[$field]; |
|
$args[$n] = $tmp; |
|
} |
|
} |
|
$args[] = &$data; |
|
call_user_func_array('array_multisort', $args); |
|
return array_pop($args); |
|
} |
|
|
|
?> |
|
|
|
|
|
<meta name="viewport" content="width=device-width,initial-scale=1" /> |
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
|
<script src="https://cdn.bootcss.com/clipboard.js/1.7.1/clipboard.min.js"></script> |
|
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> |
|
<script> |
|
var cookie = { |
|
set: function(name, value) { |
|
var Days = 1; |
|
var exp = new Date(); |
|
exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000); |
|
document.cookie = name + '=' + escape(value) + ';expires=' + exp.toGMTString(); |
|
}, |
|
get: function(name) { |
|
var arr, reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); |
|
if(arr = document.cookie.match(reg)) { |
|
return unescape(arr[2]); |
|
} else { |
|
return null; |
|
} |
|
}, |
|
del: function(name) { |
|
var exp = new Date(); |
|
exp.setTime(exp.getTime() - 1); |
|
var cval = getCookie(name); |
|
if(cval != null) { |
|
document.cookie = name + '=' + cval + ';expires=' + exp.toGMTString(); |
|
} |
|
} |
|
}; |
|
if(cookie.get('login')!=1){alert('非法访问!');window.location.href="./"} |
|
|
|
</script> |
|
|
|
<p>ss://<?php echo $str?> |
|
<br/> |
|
</p> |
|
<div><span id="btn" data-clipboard-text="ss://<?php echo $str?>"><button>点击复制</button></span></div> |
|
<div id="show" style="display: none;">已复制</div> |
|
<script> |
|
var btn = document.getElementById('btn'); |
|
var clipboard = new Clipboard(btn); |
|
clipboard.on('success', function(e) { |
|
$('#show').slideDown().delay(1500).slideUp(300); |
|
console.log(e); |
|
alert("复制成功!"); |
|
window.location.href = "https://uk.cloud.yimian.xyz/index.php/s/3A5F2ia6kGykEDy" |
|
}); |
|
clipboard.on('error', function(e) { |
|
$('#show').slideDown().delay(1500).slideUp(300); |
|
console.log(e); |
|
}); |
|
</script> |
|
<script>//log visit |
|
|
|
var url=window.location.pathname+window.location.search; |
|
var domain= document.domain; |
|
|
|
|
|
$.ajax({ |
|
type: "POST", |
|
url: '/log.php', |
|
data: { "url": url, |
|
"domain": domain},//使用这种数组方式的,得加下一句才可以,使用传统方式 |
|
traditional: true, |
|
dataType: 'json', |
|
error: function (data,type, err) { |
|
alert('Could not log your visit!'); |
|
} |
|
}); |
|
</script>
|