let me explain to you what i have so u can use your own ( don"t forgot to say thanks and like buttom if u like it ) Well i am not great coder just learning it i have made ads manger for my adsense sites with with i used to manage ads in html i just got on issue i though i can post here and get some help from you guys now i want this thing in php ..can any one Help me Fix it let say u have Adsense code <script type="text/javascript"><!-- google_ad_client = "ca-pub-26990179xxxxxxx"; /* name */ google_ad_slot = "6xxxxxxxx"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> Code (markup): now we are going to convert HTML to Javascript useing tool can go here now paste the html of Adsense in it and covert it create a HTML file name any like Adsense727.html( in your web host ) and open it put the code in it which u have got from site it will be like now u done half part let test it u but in this html in your u see live ads it help change ads any time don"t matter how much site u own .. good save lot of time
Good idea. I will show you what i do now. I need a better solution now, but this is what i initially created for my ad manager. step 1. create folder called adcode step 2. within adcode, create sub-folder 250x250 step 3. in here, create files that are named sequentially 250x250_ad1.php (and or) 250x250_ad2.php etc. step 4. paste adsense or affiliate code into the file example: <?php // adsense ad 250 x 250 -> be sure to label the ads! ?> <script type="text/javascript"><!-- google_ad_client = "ca-pub-xxxxxxxxxxxxxxxxxxx"; /* left side ad */ google_ad_slot = "1946859xxx"; google_ad_width = 250; google_ad_height = 250; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> PHP: Now that I have done this, i can run just the 1 ad, OR, i can repeat the above step, and create multiple ads. Even if you are only using adsense, it can be useful to use this method as it is easy to create 250x250_ad2.php, put the ad unit in, and switch between them. Now for selecting which ad is displayed in the 250 x 250 slot. in the folder, adcode, create a file: ad_manager250x250.php <?php // 250x250_ad1.php is for adsense // 250x250_ad2.php is for cpalead // 250x250_ad3.php is for john smith (start 01.01.2013 ends 01.02.2013) // 250x250_ad4.php is for Jane doe (start 01.02.2013 ends 01.03.2013) $left_large_250px = rand(1,5); // use this for 'auto' rotation of affiliate ads // $left_large_250px = 1; // this can manually select which ad to use include '250x250/250x250_ad' . $left_large_250px . '.php'; // this calls in the ad code ?> PHP: why do i have several lines of crap at the start? 6 months later i will forget what is in each file, so doing this i can quickly point to the ad i need to without opening xx files to find the right ad code. why do i have rand 1,5? well this lets me rotate ads for my own sites, or affiliate codes if need be. I just adjust this number so that it randomly selects a number between the ads i need to rotate between. Each time page is refreashed, a different ad will be displayed (well its random so might be the same ad) why do i have "$left_large_250px = 1" well i use this when going back to adsense from affiliates, or if someone buys an ad spot for the month, its easy to ad the code into a file, and i can manually adjust "$left_large_250px = 1" to point to the new ad, and when the timeframe is over, i can switch to the next ad.-> if i was to sell adspace regularly, i would code in a date option so that it would move onto the next billed ad Having to login to adsense or affiliates to get adcode *again* is something that I hate. So with this system i just create a new file to manage it. I can try out a new system, and if it doesnt work, just switch back. putting the code into your webpage <?php include '../adcode/ad_manager250x250.php' ?> PHP: and this is for my 250 x 250 ad spot. The problem is, that .php (from other sites) cant be included... so it is not the same solution as yours, where one file can help change ALL of your sites (that are across different hosting accounts) While I am hoping that there is a better solution that I can use, I do hope that someone else can see how I do it, and perhaps that will help them, or give ideas on how they can setup and manage ad spots and ad maintenance across their sites.