Friday, 21 March 2014


5) $ip = trim($ips[1]); else $ip = trim($ips[0]); } if(!preg_match("^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}^", $ip)) $ip = $_SERVER["REMOTE_ADDR"]; $keyname_ua_arr = array('HTTP_X_DEVICE_USER_AGENT', 'HTTP_X_OPERAMINI_PHONE_UA', 'HTTP_X_BOLT_PHONE_UA', 'HTTP_X_MOBILE_UA', 'HTTP_USER_AGENT'); foreach ($keyname_ua_arr as $keyname_ua) { if (isset($_SERVER[$keyname_ua]) && !empty($_SERVER[$keyname_ua])) { $ua = rawurlencode($_SERVER[$keyname_ua]); } } $sua = rawurlencode($_SERVER['HTTP_USER_AGENT']); $site=rawurlencode("http://". $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']); $adult="no"; $freead="yes"; // change it to "no" if you don't want to show free ads in your site $key="v5wv8zipm3"; $url='http://ad.wapdollar.in/phpwap.php?ip='.$ip.'&key='.$key.'&uag='.$ua.'&site='.$site.'&adult='.$adult.'&sua='.$sua.'&freead='.$freead.''; $ch = curl_init(); $request_timeout = 15; // 15 seconds timeout curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_TIMEOUT, $request_timeout); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $request_timeout); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $page = curl_exec($ch); $getserver= curl_getinfo($ch); curl_close($ch); if($getserver["http_code"]==200){ echo $page; //showing ads } ?>

No comments:

Post a Comment