I have just finished updating the old ASP.Net version of the Ad Network. The updated version has the following improvements: Easy to setup - Just two lines of code. No malformed HTML tags Support for tracking Resistance to file locking errors File locking to prevent overwriting You can download it from here: http://www.vlead.com/misc/coopad_control.htm (Comes with complete source code and sample implementations). Shawn: Please have a look at it and let me know if there's something that needs to be changed.
Could things I noticed just by skimming it... DNS resolution of validate.digitalpoint.com should ONLY happen when a new ad comes in, otherwise it should just write back what it already had in the file. The img should probably have a space towards the end, like so: width="1" /> instead of width="1"/> The .txt file should still be rebuilt if it tried (but failed) to get an ad from the ad server. That way it knows not to try for awhile (15 minutes by default). Doing that should save all the settings from the current file (obviously since it can't get new settings since the request failed). This is major, because if something happens (like the ad server needs to be reboot for whatever reason), everyone's site would be screwed up while it waits to get a new ad for every page request, and also would probably cause a DoS attack against the ad network server, since it would start making requests for every page view.
This is done. This is also done. Nothing is written to the ad file when the ad file is empty and the control tries to get ad from the DP server but fails... because it doesn't know what to write. But if the ad file is not empty, it rewrites the ad file even if does not get ads from the DP server. The updated file is available from the same (previous) URL.