I currently have a company which offers free web hosting. As part of the terms of free hosting we place Google Adsense in the header of the user’s website.
What I would like to have done is for the user to be able to submit their own Google Adsense publisher ID information under their hosting account. Then for ads to be rotated on the user’s website on an equal ratio; 50% of the time my Google ads are displayed and the other 50% are the users.
I require a very simple edit to my current free hosting script, Layered Panel ([url removed, login to view]), to allow users to add there Google Adsense Publisher ID (as seen in the uploaded image). This data should put into the Layered Panel database so that it correlates the users Adsense publisher ID with the users hosted domain or sub-domain name.
The script needs to be made so that when any hosted website is displayed, the script will look up the domain or sub-domain from the database and work out if either ours or the users Google ads should be displayed. The script should be making sure that all ads are displayed at exactly half and half ratio.
Finally, if the script decides it is the users Google ads that should be displayed, it grabs the publisher ID from the database and puts it into the Adsense code. Conversely if it is our turn, it puts our publisher ID into the Adsense code.