• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

script / program to check for ad codes

Squad-Host.com

New Member
Well i am wondering if there is any scripts / programs out there that will check for ad codes on the sites that i host, i don't want one to force teh ads, just want one that will tell me what users are not placing the ads on site, and what not. does any thing like this exists, i once used a free host that had something like this.
 
Glenn, would that be very hard to do?

Would anyone here be willing to create something like that (for pay, of course)?
 
Not really. It could be quite simple using an Explode code.

PHP:
<?php
$adcode="<a href=linkto>linkto, the best ad in the world</a>";
$f = fopen("http://website.com/", 'r');
$fr = fread($f, "30000"); //Read 29 KB of the website.
$x = explode($addcode,$fr);
if(count($x) >= 2){
//There is at least 1 instance of the add code within the website.
}
?>
It's a little basic and not terribly effective, there'd need to be a !eof loop to read the whole site, if you wanted to scan every page on a website, that would kill your server load and would require a much more sophisticated script then that being presented.

This script is basic, yet sophisticated enough to search through the first 29KB of a website and look for the add code, then return with an IF statement to do what you want. It can be modded to do a wee bit more but meh, I just wrote this as I was typing.

The presented script has not been tested
 
Well i am wondering if there is any scripts / programs out there that will check for ad codes on the sites that i host, i don't want one to force teh ads, just want one that will tell me what users are not placing the ads on site, and what not. does any thing like this exists, i once used a free host that had something like this.
Why don't forbid users to do so. I mean leave no ability to do so?
 
This would be a good way to build a ads system that doesn't use root to force ads. Willingly let the user put the code where they want and the script checks it every month say.
 
When I provided free hosting with ads, I just send e-mail's to all my clients saying accounts will be terminated within 24 hours if ads are not placed on every page.

It worked 90% of the time :D
 
Back
Top