Images Next to Adsense

My friend did ask about how to have images next to Adsense. It quite easy to do that for static image, but I’m going to show here how webmasters can have random images next to .

This can be done easily with these steps;

1. Have some gif files, name them as 1.gif, 2.gif, 3.gif etc. Number of files can be 2 or more.

2. Put them in a folder, say “icons”.

3. Have this PHP file name as index.php


<?php
header("content-type: image/gif\ncache-control: no-store\n");

$dh = opendir(".");
$contains = array();

while ($content = readdir($dh)) {
if (ereg('.gif',$content)) {
array_push($contains,$content);
}
}
srand((double)microtime()*1000000);
$which = rand() % (count($contains)-1);

$fh = fopen("$contains[$which]","r");

$data = fread($fh,250000);
print ($data)
?>

4. Put index.php in “icons” folder.

5. Upload “icons” folder with it’s content to your root directory as your files.

Okay, that’s for the settings. Now follow this little coding. We are going to wrap the random images and ads in a table.

This is a sample code:

</p>

<table>
<tr>
<td><img src="http://yourdomain.com/icons/"></td>
<td>Your Google Code Here</td>
</tr>
</table>

It’s that simple.

If you are using , just put the above code (with your ads of course) in the configuration set.

Posted September 16th, 2006 by mightyhitter under Google Adsense, Wordpress

 

15 Responses to “Images Next to Adsense”

  1. Adsense Planet » Images Next to Adsense Says:

    […] Original post by mightyhitter.com. To read the full article visit: mightyhitter.com […]

  2. alhafiz3d Says:

    heh.. simple but berkesan.

  3. WP Rich Editor » mightyhitter.com Says:

    […] Lets have another try here. I still want to exhibit the simple code from my last post (and want to edit it in the future if necessary - that’s what rich editor incapable of); […]

  4. KingPin Says:

    Easy yet also illegal by Adsense standards…. they have shutdown a few sites in the recent moths for having images next to adsense links…

  5. mightyhitter Says:

    having the images is not illegal, but trying to give extra attention to the ads using the images is not allowed. for eg; using image of arrow showing to the image ..it’s not allowed.
    however, the best policy is to email the google team and ask them about your site.

  6. Bloggero Says:

    Not working for me :(

  7. mightyhitter Says:

    hi Bloggero,
    take note that sample code should be:

    src=”http://yourdomain.com/icons/”

    not

    xsrc=”http://yourdomain.com/icons/”

    as per described before.

  8. mike Says:

    Mightyhitter -

    Great, great plugin. I really dig it. I’m trying to put images next to my ads but I’m getting an error: [18-Oct-2006 17:09:57] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/user/public_html/test/index.php:2) in /home/user/public_html/test/index.php on line 3
    [18-Oct-2006 17:10:39] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/user/public_html/test/index.php:2) in /home/user/public_html/test/index.php on line 3

    I put the index.php and images in a folder/directory called “test”.

  9. mightyhitter Says:

    mike, be sure you write nothing before <?php tag. there should be no empty lines whatsoever, else the browser will output the lines or character thus triggering the error that you got there.

  10. mike Says:

    That did it, mh. You are the man. Thanks for your help.

  11. Ed Says:

    Looks great. Im going to put it on my site http://hghlook.com to see how it goes.

  12. flwong Says:

    Hey Guru,

    Great plug-in and tips man. Must come to this blog often to learn from you gurus. Me…hmmmmm a newbie in wordpress blogging.

    cheers,

  13. Ted Says:

    Looks great. I’m going to put it on my site http://weightlosshd.com Please tell me what you think. Thanks

  14. Using Images Next to Google Ads - Abuse the Policy? // mightyhitter.com Says:

    […] I wrote an article on how to have random images next to Google before. However I read somewhere on the net that Google now has changed it’s policy about that, but I can’t find where the article is coming from. However thanks Joel Comm for sending me an email about this. […]

  15. Aldian Prakoso Says:

    Thanks for the great tips. It blends AdSense more into the blog :)

Leave a Reply