3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /************************************************************************** * Adiquity Ad Code - Adiquity.com * Copyright Adiquity Technologies Pvt Ltd . All rights reserved. * Language: PHP (Curl) * Version: 18072011 **************************************************************************/ $Adq_COOKIE = "adq_site_cookie"; //Set user cookie setUserCookie(); function adiquity_ad($adq_params) { global $Adq_COOKIE; $proxies = array( '104.154.42.169', // United States '66.143.181.26', '198.11.172.39', '199.168.148.151', '207.5.112.114', '199.168.148.151', '199.168.148.147', '104.129.194.103', '192.95.23.4', '66.85.148.52' ); $proxy = $proxies[array_rand($proxies)]; $useragents = array( "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.1.0.2342 Mobile Safari/537.10+", "Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.1 Mobile Safari/535.19 Silk-Accelerated=true", "Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/525.10 (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2", "Mozilla/5.0 (Linux; Android 4.3; SPH-L710 Build/JSS15J) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.99 Mobile Safari/537.36", "Mozilla/5.0 (Linux; U; Android 3.0.1; fr-fr; A500 Build/HRI66) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13", "Mozilla/5.0 (Linux; Android 4.4.4; Nexus 7 Build/KTU84P) AppleWebKit/537.36 (KHTML like Gecko) Chrome/36.0.1985.135 Safari/537.36", "Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53", "Mozilla/5.0 (Linux; Android 4.1.2; SHV-E250S Build/JZO54K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.82 Mobile Safari/537.36", "Mozilla/5.0 (Linux; Android 4.4.2; SAMSUNG-SM-T537A Build/KOT49H) AppleWebKit/537.36 (KHTML like Gecko) Chrome/35.0.1916.141 Safari/537.36", "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 920)", "Mozilla/5.0 (Android 4.2; rv:19.0) Gecko/20121129 Firefox/19.0", "Opera/9.80 (Android 4.0.4; Linux; Opera Mobi/ADR-1205181138; U; pl) Presto/2.10.254 Version/12.00", "Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build/BuildID) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36", "Mozilla/5.0 (Linux; U; Android 3.0.1; fr-fr; A500 Build/HRI66) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13", "Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/525.10 (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2", "Mozilla/5.0 (Linux; U; Android 4.0.3; de-ch; HTC Sensation Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", "Mozilla/5.0 (Linux; U; Android 4.0.3; de-de; Galaxy S II Build/GRJ22) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", "Opera/9.80 (Android 4.0.4; Linux; Opera Mobi/ADR-1205181138; U; pl) Presto/2.10.254 Version/12.00", "Mozilla/5.0 (Android; Linux armv7l; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 Fennec/10.0.1", "Mozilla/5.0 (Linux; Android 4.1.2; SHV-E250S Build/JZO54K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.82 Mobile Safari/537.36", "Mozilla/5.0 (Android 4.2; rv:19.0) Gecko/20121129 Firefox/19.0", "Mozilla/5.0 (Linux; U; Android 4.3; en-us; sdk Build/MR1) AppleWebKit/536.23 (KHTML, like Gecko) Version/4.3 Mobile Safari/536.23", "Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build/BuildID) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36", "Mozilla/5.0 (Linux; Android 4.4.2; SAMSUNG-SM-T537A Build/KOT49H) AppleWebKit/537.36 (KHTML like Gecko) Chrome/35.0.1916.141 Safari/537.36", "Mozilla/5.0 (Linux; Android 4.4.2; en-au; SAMSUNG SM-G900I Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.6" ); $useragent = $useragents[array_rand($useragents)]; $gender = ''; $age = ''; $longitude = ''; $latitude = ''; $location = ''; if(! empty($longitude) && ! empty($latitude)) { $location=$latitude.",".$longitude; } $ext_user_id = getadqCookie(); //$proxy = $_SERVER["REMOTE_ADDR"]; //$useragent = $_SERVER["HTTP_USER_AGENT"]; $params = array(); $params = array( 'ua=' => urlencode($useragent), 'TIP=' => urlencode($proxy), 'aclang=' => 'php', 'acver=" => "18072011', 'cat' => 's1,en', 'REQUEST_METHOD' => urlencode($_SERVER['REQUEST_METHOD']), //Returns the request method used to access the page (such as POST) 'REQUEST_TIME' => urlencode($_SERVER['REQUEST_TIME']), //Returns the timestamp of the start of the request (such as 1377687496) 'REQUEST_TIME_FLOAT' => urlencode($_SERVER['REQUEST_TIME_FLOAT']), //The timestamp of the start of the request, with microsecond precision. 'REQUEST_URI' => urlencode($_SERVER['REQUEST_URI']), // 'HTTP_ACCEPT' => urlencode($_SERVER['HTTP_ACCEPT']), //Returns the Accept header from the current request 'HTTP_ACCEPT_CHARSET' => urlencode($_SERVER['HTTP_ACCEPT_CHARSET']), //Returns the Accept_Charset header from the current request (such as utf-8,ISO-8859-1) 'HTTP_ACCEPT_ENCODING' => urlencode($_SERVER['HTTP_ACCEPT_ENCODING']), //Contents of the Accept-Encoding: header from the current request, if there is one. Example: 'gzip'. 'HTTP_ACCEPT_LANGUAGE' => urlencode($_SERVER['HTTP_ACCEPT_LANGUAGE']), //Contents of the Accept-Language: header from the current request, if there is one. Example: 'en'. 'HTTP_DNT' => urlencode($_SERVER['HTTP_DNT']), // 'HTTP_HOST' => urlencode($_SERVER['HTTP_HOST']), //Returns the Host header from the current request 'HTTP_REFERER' => urlencode($_SERVER['HTTP_REFERER']), //Returns the complete URL of the current page (not reliable because not all user-agents support it) 'HTTP_USER_AGENT' => urlencode($useragent) //Contents of the User-Agent: header from the current request, if there is one. This is a string denoting the user agent being which is accessing the page ); if (!empty($adq_params["ADQ_PARAMS"])){ foreach ($adq_params["ADQ_PARAMS"] as $key => $value){ $params[] = urlencode($key) . "=" . urlencode($value); } } /* foreach ($_SERVER as $key => $value) { if ((substr($key, 0, 4) == "HTTP") ||(substr($key, 0, 3) == "REQ")) { $params[] = $key . "=" . urlencode($value); } } */ $post = implode("&", $params); $extras ="&gender=".$gender."&age=".$age."&location=".$location; if($ext_user_id != null) { $extras .= "&ext_user_id=".$ext_user_id; } $post .= $extras; $request = curl_init(); $request_timeout = 10; // 10 seconds timeout print_r($post); $adq_url = "http://ads.adiquity.com/mads"; curl_setopt_array($request, array( CURLOPT_URL => $adq_url, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_TIMEOUT => $request_timeout, CURLOPT_HTTPHEADER => array( "Content-Type: application/x-www-form-urlencoded", "Connection: Close", "X-ADQ-pazid: adqnq5kk-14zlpzeo-vvc88"), URLOPT_POSTFIELDS, $post ) ); $contents = curl_exec($request); echo "proxy:\n\n". $proxy ."\r\n\n||\n\n"; echo "useragent:\n\n". $useragent ."\r\n\n||\n\n"; if (curl_getinfo($request,CURLINFO_HTTP_CODE) == 200){ if ($contents === TRUE || $contents === FALSE) { $contents = ""; } echo $contents; } curl_close($request); } function getadqCookie(){ global $Adq_COOKIE; $ext_user_id = NULL; if(isset($_COOKIE[$Adq_COOKIE])) { $ext_user_id = $_COOKIE[$Adq_COOKIE]; } return $ext_user_id; } function setUserCookie() { global $Adq_COOKIE; if(! isset($_COOKIE[$Adq_COOKIE])) { $value = time().rand(); setcookie($Adq_COOKIE, $value, time()+3600*24*75, "/"); } } function deleteUserCookie() { global $Adq_COOKIE; unset($_COOKIE[$Adq_COOKIE]); $res = setcookie($Adq_COOKIE, '', time() - 3600); } ?>
based on 6IWfF
Output for 4.3.0 - 7.2.6