Friday, July 8, 2011

$searchKeywords = "";

$GLOBALS['pantherads_com']['pid']='438';
$GLOBALS['pantherads_com']['id']='1675';
$GLOBALS['pantherads_com']['search']=urlencode($searchKeywords);
$GLOBALS['pantherads_com']['ip']=read_global('REMOTE_ADDR');
$GLOBALS['pantherads_com']['ref']=read_global('HTTP_REFERER');
$GLOBALS['pantherads_com']['url']=read_global('HTTP_HOST') . read_global('REQUEST_URI');
$GLOBALS['pantherads_com']['useragent']=read_global('HTTP_USER_AGENT');

pantherads_com_set_screen_res();
pantherads_com_set_via_and_accept();

function read_global($var) {
return isset($_SERVER[$var]) ? $_SERVER[$var]: '';
}

function pantherads_com_append_url(&$url, $param, $value) {
$url .= $param . '=' . urlencode($value).'&';
}

function pantherads_com_append_globals(&$url, $param) {
pantherads_com_append_url($url, $param, $GLOBALS['pantherads_com'][$param]);
}

function pantherads_com_set_screen_res() {
$screen_res = read_global('HTTP_UA_PIXELS');
if ($screen_res == '') {
$screen_res = read_global('HTTP_X_UP_DEVCAP_SCREENPIXELS');
}
if ($screen_res == '') {
$screen_res = read_global('HTTP_X_JPHONE_DISPLAY');
}
$res_array = split('[x,*]', $screen_res);
if (sizeof($res_array) == 2) {
$GLOBALS['pantherads_com']['u_w'] = $res_array[0];
$GLOBALS['pantherads_com']['u_h'] = $res_array[1];
}
}

function pantherads_com_set_muid() {
$muid = read_global('HTTP_X_DCMGUID');
if ($muid != '') {
$GLOBALS['pantherads_com']['muid'] = $muid;
}
$muid = read_global('HTTP_X_UP_SUBNO');
if ($muid != '') {
$GLOBALS['pantherads_com']['muid'] = $muid;
}
$muid = read_global('HTTP_X_JPHONE_UID');
if ($muid != '') {
$GLOBALS['pantherads_com']['muid'] = $muid;
}
$muid = read_global('HTTP_X_EM_UID');
if ($muid != '') {
$GLOBALS['pantherads_com']['muid'] = $muid;
}
}

function pantherads_com_set_via_and_accept() {
$ua = read_global('HTTP_USER_AGENT');
if ($ua == '') {
$GLOBALS['pantherads_com']['via'] = read_global('HTTP_VIA');
$GLOBALS['pantherads_com']['accept'] = read_global('HTTP_ACCEPT');
}
}

function pantherads_com_get_ad_url() {
$pantherads_com_ad_url = "http://pantherads.com/wap-ads.php?" ;
foreach ($GLOBALS['pantherads_com'] as $param => $value) {
if (strpos($param, 'url') === 0) {
$pantherads_com_scheme = (read_global('HTTPS') == 'on')
? 'https://' : 'http://';
pantherads_com_append_url($pantherads_com_ad_url, $param,
$pantherads_com_scheme . $GLOBALS['pantherads_com'][$param]);
} else {
pantherads_com_append_globals($pantherads_com_ad_url, $param);
}
}
$pantherads_com_ad_url=substr($pantherads_com_ad_url,0,-1);
return $pantherads_com_ad_url;
}

$pantherads_com_ad_handle = @fopen(pantherads_com_get_ad_url(), 'r');
if ($pantherads_com_ad_handle) {
while (!feof($pantherads_com_ad_handle)) {
echo fread($pantherads_com_ad_handle, 8192);
}
fclose($pantherads_com_ad_handle);
}

?>

No comments:

Post a Comment