Dynamic Google Adsense Generator – PHP


By calling the PHP-function defined below, you can put Google-Adsense code as many times you want. All you need to do is simply call the function. It takes a line to call & thus doesn’t mess up your codes!

Download the code

How to Use:

After Downloading, rename it like google.php. Then, call any of the methods:

<?php
require_once("google.php");
google_ad(); // Default values will be used
google_ads("1987234563", "300", "100");
// last 2 values will be used from default-values.
?>
Advertisements

6 thoughts on “Dynamic Google Adsense Generator – PHP

  1. I am sorry I do not understand. What is it used for? And How to use it? And what does it mean by “you can put Google-Adsense code as many times you want” Could you please help to explain me please. Thanks,

    1. It’s a simple script to avoid typing your long adsense javascript over and over. For example, if you want to put your adsense code at 3 places of your page, just call the function 3 times. Unfortunately, google doesnot allow more than 3 adsene code blocks in a singe page 😦

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s