USDT run mode subsystem development

php obtain browser information, access to visitors Language: Simplified Chinese, Traditional Chinese, English. Find Li Chan: I8O2853296O differentiable, understand USDT subsystems run mode. Visitors get Caozuoxitong: Windows, MAC, Linux, Unix, BSD, Other. Visitors get an IP address. Visitors get location, using the Sina Tencent interface. USDT run subsystems: acceptance providers need to recharge the platform USDT, USDT before advertising the sale of recharge. After waiting for matching trading business platform for docking, players merchant platform recharge after entering the amount of matching sell advertising acceptance business after a successful match (match is accepted's USDT in a frozen state) to enter the order payment page merchant platform Players need 15 minutes payment information in the press to fight money orders page to acceptance quotient (over time will cancel the order) after payment has been paid to fight money click acceptance supplier on page after receipt of payment merchant platform players, confirming the availability of funds and correct, acceptance business release orders, (USDT transferred to the corresponding merchant and merchant platform a callback to the successful recharge)

? <PHP 
/ ** 
* Get the class of visitor information: language, browser, operating system, IP, geographic location, ISP.


* Use: 
* $ obj = new new guest_info; 
* $ obj-> GetLang (); // get visitors Language: Simplified Chinese, Traditional Chinese, English. 
* $ Obj-> GetBrowser (); // get a visitor's browser: MSIE, Firefox, Chrome, Safari  , Opera, Other.
* $ Obj-> GetOS (); // get visitors Caozuoxitong: Windows, MAC, Linux, Unix  , BSD, Other.
* $ Obj-> GetIP (); // get visitor IP address. 
* $ Obj-> GetAdd (); // get visitor location, use Baidu hidden interface. 
* $ Obj-> GetIsp (); // get visitors ISP, using Baidu hidden interface. 
* / 
Class guest_info { 
function GetLang () { 
$ Lang = substr ($ _ SERVER [ 'the HTTP_ACCEPT_LANGUAGE'], 0,. 4); 
// use substr () string taken from bits 0, 4 characters taken 
if (preg_match ( '/ ZH-C / I', $ Lang)) { 
// the preg_match () regular expression matching functions 
$ Lang = 'Simplified Chinese'; 
} www.jbxue.com
ELSEIF (the preg_match ( '/ ZH / I', 


else { 
$Lang = 'English'; 

return $Lang; 

function GetBrowser() { 
$Browser = $_SERVER['HTTP_USER_AGENT']; 
if (preg_match('/MSIE/i',$Browser)) { 
$Browser = 'MSIE'; 

elseif (preg_match('/Firefox/i',$Browser)) { 
$Browser = 'Firefox'; 

elseif (preg_match('/Chrome/i',$Browser)) { 
$Browser = 'Chrome'; 

elseif (preg_match('/Safari/i',$Browser)) { 
$Browser = 'Safari'; 

elseif (preg_match('/Opera/i',$Browser)) { 
$Browser = 'Opera'; 

else { 
$Browser = 'Other'; 

return $Browser; 




























ELSEIF (! Empty ($ _ SERVER [ 'HTTP_X_FORWARDED_FOR'])) { 
$ the IP = the explode ( ',', $ _ SERVER [ 'HTTP_X_FORWARDED_FOR']); 

ELSEIF (! Empty ($ _ SERVER [ 'REMOTE_ADDR'])) { 
$ the IP = the explode ( ',', $ _ SERVER [ 'REMOTE_ADDR']); 

the else { 
$ the IP [0] = 'None'; 

return $ the IP [0]; 




$ obj = new new guest_info; 
echo $ obj -> GetLang (); // get visitors language: Simplified Chinese, Traditional Chinese, English. 
echo $ obj-> GetBrowser (); // get a visitor's browser: MSIE, Firefox, Chrome, Safari  , Opera, Other.
echo $ obj-> GetOS (); // get visitors Caozuoxitong: Windows, MAC, Linux, Unix  , BSD, Other.
echo $ obj-> GetIP (); // get visitor IP address. 

?>

A, PHP use Tencent IP sharing plan to obtain an IP location
<PHP? 
Function getIPLoc_QQ ($ queryIP) { 
$ url = 'http://ip.qq.com/cgi-bin/searchip?searchip1='.$queryIP; 
$ curl_init = CH ($ URL); 
curl_setopt ($ CH, CURLOPT_ENCODING, 'GB2312'); 
curl_setopt ($ CH, CURLOPT_TIMEOUT, 10); 
curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, to true); // get the data return 
$ result = curl_exec ( CH $); www.jbxue.com 
$ mb_convert_encoding Result = (Result $, "UTF-. 8", "GB2312"); // transcoding, or distortion 
curl_close ($ CH); 
the preg_match ( "@ <span> (. *) </ span> </ P> @iU ", Result $, $ ipArray); 
$ ipArray LOC = $ [. 1]; 
return $ LOC; 

// use 
echo getIPLoc_QQ (" 183.37.209.57 "); // you can get the address of the location where the IP address. 
?> 

<?php 
function getIPLoc_sina($queryIP){ 
$url = 'http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=json&ip='.$queryIP; 
$ch = curl_init($url); 
curl_setopt($ch,CURLOPT_ENCODING ,'utf8'); 
curl_setopt($ch, CURLOPT_TIMEOUT, 5); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) ; // 获取数据返回 
$location = curl_exec($ch); 
$location = json_decode($location); 
curl_close($ch); 
$loc = ""; www.jbxue.com
if($location===FALSE) return ""; 
if (empty($location->desc)) { 
$loc = $location->province.$location->city.$location->district.$location->isp; 
}else{ $loc = $location->desc; 

return $loc; 

echo getIPLoc_sina("183.37.209.57"); 
?>

Guess you like

Origin www.cnblogs.com/linan1/p/11484338.html