Pretty sure this is the right forum, but looking for a a way to serve forced ads on web pages that I am hosting, tutorials scripts etc, my current script hosts sites through whm / cpanel, but I want ads hosted on their websites not on their control panels. If anyone has any ideas etc it would be greatly appreciated, searched google but can't really find anything concrete
I'll assume it's a "free" hosting setup that is ad supported, and I'll just ignore the whole argument if it's a good idea or a good business model or not and move on to the actual question... Either way you are going to have to alter their page source, which you could do by passing everything through an internal rewrite rule. Of course you will want to check that you are altering the base page and not content that goes along with it (like CSS, JS or images). From there, the simplest way would be to inject a single JavaScript line into the <head> section of their page which ultimately is your ad serving JavaScript.
well i was looking at the apend function, still need to do a bit of research, and there accounts are not touchable from mine, so dont this .htaccess like that would work, it would have to be done by the apche global ini file from research, thanks for posting and giving me the idea, ill research more however and see
I'm going to actually say it... So... you WANT to make people not want to use your hosting? As to actually doing it, it really comes down to what you are going to support hosting; with static files (.html) it would be easy enough to just trap them with "AddOutputFilterByType" and just "SUBSTITUTE text/html", looking for some tag you know is going to be there like </body> and replace it with "yourAdCode</body>"... Been a while since I've done that (buggered if I can remember the syntax) but that's the best way if you aren't supporting CGI/SSI. Once you have code executing server-side this is where it can bite you; the biggest problem being that if the language is handling gzip compression instead of the server (like a lot of people do in PHP) you would either have to "buffer the output, decompress it, add your code, then send" or trap inside PHP's execution somehow -- otherwise anything you append is actually gonna result in a 500 error or worse, gibberish on the client-side of things. It's actually why most free hosts who pull these types of stunts generally don't allow PHP/Perl/ASP/Ruby/whatever'sTrendyThisWeek