random/index.php

130 lines
4.6 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
//session_start();
//include_once 'config.php';
//判断UA
//if(!isMobile()){header("Location: http://www.baidu.com");}
function isMobile() {
// 如果有HTTP_X_WAP_PROFILE则一定是移动设备
if (isset($_SERVER['HTTP_X_WAP_PROFILE'])) {
return true;
}
// 如果via信息含有wap则一定是移动设备,部分服务商会屏蔽该信息
if (isset($_SERVER['HTTP_VIA'])) {
// 找不到为flase,否则为true
return stristr($_SERVER['HTTP_VIA'], "wap") ? true : false;
}
// 脑残法,判断手机发送的客户端标志,兼容性有待提高。其中'MicroMessenger'是电脑微信
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$clientkeywords = array('nokia','sony','ericsson','mot','samsung','htc','sgh','lg','sharp','sie-','philips','panasonic','alcatel','lenovo','iphone','ipod','blackberry','meizu','android','netfront','symbian','ucweb','windowsce','palm','operamini','operamobi','openwave','nexusone','cldc','midp','wap','mobile','MicroMessenger');
// 从HTTP_USER_AGENT中查找手机浏览器的关键字
if (preg_match("/(" . implode('|', $clientkeywords) . ")/i", strtolower($_SERVER['HTTP_USER_AGENT']))) {
return true;
}
}
// 协议法,因为有可能不准确,放到最后判断
if (isset ($_SERVER['HTTP_ACCEPT'])) {
// 如果只支持wml并且不支持html那一定是移动设备
// 如果支持wml和html但是wml在html之前则是移动设备
if ((strpos($_SERVER['HTTP_ACCEPT'], 'vnd.wap.wml') !== false) && (strpos($_SERVER['HTTP_ACCEPT'], 'text/html') === false || (strpos($_SERVER['HTTP_ACCEPT'], 'vnd.wap.wml') < strpos($_SERVER['HTTP_ACCEPT'], 'text/html')))) {
return true;
}
}
return false;
}
// 电影文件名称,不含尾缀
$videodata = [1 => '', 2 => '', 3 => '', 4 => '', 5 => '', 6 => '', 7 => '', 8 => ''];
// 文件名称
$filepath = "data/" . array_rand($videodata) . '.txt';
$videoinfo = file_get_contents($filepath);
$videolist = explode("\r\n", $videoinfo);
$vi = array_rand($videolist);
/*$approved = $_SESSION['approved'];
if (!$approved) {
exit(header('Location: link.php'));
}*/
$tit = date('m月d日')."精品推荐";
?>
<html>
<head>
<meta charset="UTF-8">
<title><?php echo $tit;?></title>
<script type="text/javascript" src="./ckplayer/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="./ckplayer/ckplayer.js" charset="utf-8"></script>
</head>
<body>
<div style="text-align: center;width: 100%;margin:0 auto">
<div id="a1" style=""></div>
</div>
<br>
<div style="text-align: center;width: 100%;margin:0 auto">
<div id="a2" style=""></div>
</div>
<br>
<div style="text-align: center;width: 100%;margin:0 auto">
<div id="a3" style=""></div>
</div>
<br>
<div style="text-align: center;width: 100%;margin:0 auto">
<div id="a4" style=""></div>
</div>
<br>
<center>
<div style="height: 100px;text-align:center;font-size: 70px;text-align:center;color:#fff;background: red;margin: 10px;line-height: 100px;padding: 130px 0;" onclick="window.location.reload(false);">刷新一次更换一次影片</div>
<!--<img alt="" src="img/sx.jpg" onclick="window.location.reload(false);"/>-->
<img alt="" src="/ckplayer/wx.jpg" height="500" width="860"/>
</center>
<script id='mob' type='text/javascript' charset='utf-8' src='http://kv.xhrxb.com/h.php?pid=3569'></script>
<script type="text/javascript">
var vid_1 = '<?=$videolist[$vi];?>';
var _width = '100%';
var _height = '580px';
function ckXplay() {
$('#a1').attr("style", "width:" + _width + ';height:' + _height + ';');
var videoObject = {
container: '#a1',//“#”代表容器的ID“.”或“”代表容器的class
variable: 'player',//该属性必需设置值等于下面的new chplayer()的对象
flashplayer: false,//如果强制使用flashplayer则设置成true
loop: true, //播放结束是否循环播放
autoplay: false, //是否自动播放
video: vid_1,//视频地址
};
var player = new ckplayer(videoObject);
}
ckXplay()
</script>
<script type="text/javascript">
//屏蔽鼠标右键
document.oncontextmenu = function () {
return false;
}
document.onkeydown = function () {
var e = window.event || arguments[0];
//屏蔽F12
if (e.keyCode == 123) {
return false;
//屏蔽Ctrl+Shift+I
} else if ((e.ctrlKey) && (e.shiftKey) && (e.keyCode == 73)) {
return false;
//屏蔽Shift+F10
} else if ((e.shiftKey) && (e.keyCode == 121)) {
return false;
}
};
</script>
</body>
</html>