Home > Backend Development > PHP Tutorial > PHP determines time zone and browser language_PHP tutorial

PHP determines time zone and browser language_PHP tutorial

WBOY
Release: 2016-07-13 17:49:36
Original
1319 people have browsed it

Black hat code for PHP to determine time zone and browser language.
Once the sword is in hand, it depends on the swordsmanship of the person wielding the sword. This code can be further improved to make it more secretive. I just made a basic one, the details will depend on how you use it.

//Set time zone to China
date_default_timezone_set("PRC");
//Example output: 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); //Only take the first 4 digits, so that only the highest priority language is judged. If you take the first 5 digits, en and zh may occur, which affects the judgment.

if($time_hour<13 || $time_hour>=18){
             echo "<script>";<br>              echo "window.location.href='http://www.BkJia.com'";<br>              echo "</script>";
}elseif($time_hour>=8 && $time_hour<12 && preg_match("/zh-c/i", $lang)){
​​​​ //Non-Chinese browser
             echo "<script>";<br>               echo "window.location.href='http://www.BkJia.com'";<br>              echo "</script>";
}
else{

}
?>


Excerpted from .xssxss.com

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478335.htmlTechArticlePHP black hat code to determine time zone and browser language. Once the sword is in hand, it depends on the swordsmanship of the person wielding the sword. This code can be further improved to make it more secretive. I just made one...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template