<?php
/**
* PHP Header
*
* Created by ty1921@gmail.com
* Ver : V1
* Date: 2017-8-18
*/
//1 session
session_start();
//2 display_errors
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
//3 debug mode
if( $_REQUEST['debug'] ==1 )
{
error_reporting(E_ALL); //debug mode
print_r($_REQUEST);
print_r($_SESSION);
}
else
{
error_reporting(E_ALL && ~E_NOTICE); //normal
}
//4 encode
header('Content-type:application/javascript;charset=utf-8'); //2.1 html
//header("Content-Type:text/html;charset=utf-8"); //2.2 interface
//5 no cache
header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
//6 timezone
date_default_timezone_set("PRC");
//7 Interface brush (based on sessionid, with single sign on to be valid)
//Check interval two request, not less than N seconds
$n = 0.1;
if( empty( $_SESSION['request_last_time'] ) )
{
$_SESSION['request_last_time'] = time();
}
else
{
$timediff = time() - $_SESSION['request_last_time'];
if( $timediff < $n )
{
$res = array ( 'code'=>0,'msg'=>'request too fast','times'=>time() );
exit( $_GET['callback'].'('.json_encode($res).')');
}
$_SESSION['request_last_time'] = time();
}
<!--[if lt IE 7 ]><html class="oldie ie ie6"> <![endif]-->
<!--[if IE 7 ]><html class="oldie ie ie7"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html> <!--<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> 改为自己的title </title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="author" content="ty1921@gamil.com" />
<meta name="Copyright" content="" />
<link rel='shortcut icon' type='image/x-icon' href='images/yileyuan_icon.png' data-title='浏览器桌面快捷图标'/>
<link rel='apple-touch-icon' type='image/x-icon' href='images/yileyuan_icon.png' data-title='Safari浏览器桌面快捷图标'/>
<!-- 移动端禁止缩放 -->
<meta name='viewport' content='width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<!-- 让IE浏览器用最高级内核渲染页面 还有用 Chrome 框架的页面用webkit 内核 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- IOS6全屏 Chrome高版本全屏 -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<!-- 让360双核浏览器用webkit内核渲染页面 -->
<meta name="renderer" content="webkit">
<!-- 最小化浏览器UI -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
<meta name="format-detection" content="telephone=no">
<!--[if lt IE 9]>
<script src="http://cdn.bootcss.com/html5shiv/r29/html5.js"></script>
<![endif]-->