I'm looking for a script that would be able to do a check to see if the ads are showing or if they are returning a 404 error / down without a ping. Anyone have any ideas? I was more or less looking for something that could tell if auctionads was down and if they were it would switch the ads to something else untill they returned back online.
An fopen will still return a value if a 404 is thrown and if their page is customized it can be hard to tell if it is actually a 404. You really need to check the http response headers and determine if a '404 Not Found' was sent. CURL will enable you to accomplish this. You can send a CURL GET Request to the server and then analyze the HTTP response and see if you can find '404 Not Found'. This page should get you started: http://wiki.ittoolbox.com/index.php/Use_curl_from_PHP:_processing_response_headers
http://uk2.php.net/get_headers Array ( [0] => HTTP/1.1 200 OK [1] => Date: Sat, 29 May 2004 12:28:13 GMT [2] => Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) [3] => Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT [4] => ETag: "3f80f-1b6-3e1cb03b" [5] => Accept-Ranges: bytes [6] => Content-Length: 438 [7] => Connection: close [8] => Content-Type: text/html )