Hello Can somebody help me to make Coop code to work with curl? (i can't use file_get_contens) here is my website: www.webfabryka.com/test.php
Here You go: if (!function_exists('GetCurlPage')) { function GetCurlPage ($pageSpec) { global $agent; if (!$agent) $agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"; $header[] = "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*"; $header[] = "Connection: Keep-Alive"; $ch = curl_init($pageSpec); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt ($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_REFERER, $refferer); curl_setopt($ch, CURLOPT_TIMEOUT, 120); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60); $tmp = curl_exec ($ch); curl_close ($ch); unset($ch); return $tmp; } } PHP: Add this to coop ad network php file. Replace $new_ad = file_get_contents with $new_ad = GetCurlPage Works for me.
Thanks for Your help. Still don't working. (one ad served 5 times) and notices: Notice: Undefined offset: 3 Notice: Undefined offset: 4 Notice: Undefined offset: 1