I'm getting this error while trying to pull ads.: Warning: file_get_contents(http://ads.digitalpoint.com/network.php?b=www.*.com&type=link): failed to open stream: Connection refused in /*/*/*/*/httpdocs/ad_network.php on line 40 | | | | I switched from the CGI version to start using the latest PHP version because the CGI version as mentioned in another thread obviously is having cache-ing problems therefor banning my IP every few days. The CGI version worked fine as I could get ads and what not, but I just switched to this version and I'm getting this error. Any ideas?
Here's the IP..65.98.60.194 can you check ? If it's blocked I have a few other IPs that may be blocked as well. :| again..... I'm moving away from using the CGI version as it has obvious problems, now i'm implemeting the php version for my websites.
I was using the old cgi version. Now I'm just updating to the PHP version. It would be nice if an updated CGI version would be relased. Has the IP been unblocked yet?
huh? CyberSEO, Shawn is talking about unblocking his IP. I am asking which version of the cgi implementation he used...there are two. There is a wrapper version of the cgi that uses the PHP version as well. Was curious which you were using and when you ran into problems.
I believe it was your version chachi. I wasn't using the wrapper version. I started running into problems over the past few weeks. ====================================================== I'm still getting this error shawn... 'Warning: file_get_contents(http://ads.digitalpoint.com/network.php?b=www.*.com&type=link): failed to open stream: Connection refused in /home/httpd/vhosts/snapbug.com/httpdocs/ad_network.php on line 40'
sorry to bump this thread, but any ideas on why this may be happening? also I have ads showing here: http:// ps2-world.us , but when I validate says ads not found on http:// ps2-world.us . I clicked the button probably like 10 times and still nothing.
@DP: Can you check and see if this IP is banned? 67.15.56.36 I just switched to the PHP version *updated one* from the CGI version and I'm not receiving any ads so I'm guessing that it's blocked.
One question. I already have the ads being called from another script called coop.php that way I just included it into all of my pages 'include virtual=coop.php' blah blah... but I'm getting this turnout when using the new updated file. "Array" this is what I have in my coop.php file: <?php include ('ad_network.php'); echo $ad_network; ?> Code (markup): Any suggestions?
I'm pretty sure. This is the file i'm using: <?php // Last update: Feb 22, 2005 2:18 pm if (!function_exists('file_get_contents')) { function file_get_contents($url) { $handle = fopen($url, 'r'); $string = fread($handle, 4096000); fclose($handle); return $string; } } if (!function_exists('make_seed')) { function make_seed() { list($usec, $sec) = explode(' ', microtime()); return (float) $sec + ((float) $usec * 100000); } mt_srand (make_seed()); } if (!isset($_SERVER)) $_SERVER = $HTTP_SERVER_VARS; $ad_file = 'ad_network_ads.txt'; for ($i = 0; $i <= 11; $i++) { $p = substr ('../../../../../../../../../../', 0, $i * 3); if (file_exists ($p . $ad_file)) { $ad_file = $p . $ad_file; break; } } if (is_writable ($ad_file)) { $ads = file_get_contents ($ad_file); $ads = explode ('<ad_break>', $ads); $ads_temp = explode ('|', $ads[0]); $file = fopen($ad_file, 'r+'); if (flock ($file, LOCK_EX|LOCK_NB, $would_block) && !$would_block) { if ((count ($ads) < $ads_temp[3] + 1 && $ads_temp[0] + $ads_temp[5] < time()) || $ads_temp[0] + $ads_temp[4] < time()) { $new_ad = file_get_contents ('http://ads.digitalpoint.com/network.php?b=' . $_SERVER['SERVER_NAME'] . '&type=link'); if ($new_ad) { $ads_param = explode ('<ad_param>' , $new_ad); $new_ad = $ads_param[1]; unset ($ads_param[1]); $ads_temp = explode ('|', $ads_temp[0] . '|' . $ads_temp[1] . '|' . $ads_param[0]); } else { $ads_param = array_slice ($ads_temp, 2, 4); } $ads[0] = time() . '|' . gethostbyname('validate.digitalpoint.com') . '|' . implode ('|', $ads_param); if ($new_ad) { $ads[] = $new_ad; if (count ($ads) > $ads_temp[3] + 1) $ads = array_merge ((array)$ads[0], (array)array_slice ($ads, -$ads_temp[3])); } fwrite ($file, implode ('<ad_break>', $ads)); ftruncate ($file, ftell($file)); $ad_network[] = $new_ad; } flock ($file, LOCK_UN); fclose ($file); } while (count ($ad_network) < 5) { $ad_network[] = $ads[mt_rand(1,count($ads) - 1)]; } foreach ($ad_network as $key => $ad) { if ($ads_temp[1] == $_SERVER['REMOTE_ADDR'] || $_SERVER['SERVER_ADDR'] == $_SERVER['REMOTE_ADDR']) { $ad_network[$key] = str_replace ('" />', '" class="' . $ads_temp[2] . '" />', $ad); } else { $ad_network[$key] = str_replace ('" />', '">', $ad); } } } else { $ad_network[] = 'You must set the ad network .txt file to be writable.'; } if (substr (@$_SERVER['DOCUMENT_NAME'], -6) == '.shtml') { ini_set ('zlib.output_compression', 0); echo end ($ad_network); } ?> Code (markup):
Everything working good. I'm still baffled though on why I'm getting this error from one of my websites: Warning: file_get_contents(http://ads.digitalpoint.com/network.php?c=*.com&type=link): failed to open stream: Connection refused in /home/httpd/vhosts/*.com/httpdocs/ad_network.php on line 40 | | | | " IP is: 65.98.60.194 It pulled the ads nicely with the cgi script, don't know why its not doing the same with the php script. :\