search
Homephp教程php手册PHP判断时区判断浏览器语言

PHP判断时区判断浏览器语言

Jun 13, 2016 am 10:48 AM
phpcodejudgmentTime zoneBrowseroflanguageblack

PHP判断时区判断浏览器语言的黑帽代码。
剑在手了,就看使剑的人的剑道如何了,这段代码可以进一步改进,做到更加隐秘。我只是弄了个基本的出来,具体还得看客观您怎么用了。
 
//将时区设置为中国
date_default_timezone_set("PRC");
//例输出:2010-03-06 Saturday 11:51:29 AM
//echo date("Y-m-d l H:i:s A");
 
$time_hour = date("H");
echo $time_hour;
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 4); //只取前4位,这样只判断最优先的语言。如果取前5位,可能出现en,zh的情况,影响判断。
 
if($time_hour=18){
         echo "<script>";<br /> echo "window.location.href=&#39;http://www.BkJia.com&#39;";<br /> echo "</script>";
}elseif($time_hour>=8 && $time_hour          //非中文浏览器
         echo "<script>";<br /> echo "window.location.href=&#39;http://www.BkJia.com&#39;";<br /> echo "</script>";
}
else{
 
}
?>


摘自 .xssxss.com

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use