Hello Everyone, I’m back again ho ho ho 😛

This time I will write tutorial on “how to make random ads” using php and text as database. This idea comes from gmail interface my lovely free mail account! pfffftt yea .. yea.. we all know gmail are better than ymail *lol* 😛gmail

gmail

Alright leave them fight alone *not our business* before we start to make random ads we have to understand why we should make random ads? if we can fill those ads space with permanent ads. Most of people are bored about ads and ads on all website. Dilemma! in webmaster side we have to earn some revenue to keep continue, in costumer side sometimes they hate if we push to many ads on web page.

So? why not making random ads on your ads space some paid ads and some free ads you can use to help your costumer for what they looking for. Simple as 1-2-3 now open your superb text editor NOTEPAD and copy this code:

<?php
$fcontents = join (“”, file (“random_ads.txt“));
$s_con = split(“~”,$fcontents);
$banner_no = rand(0,(count($s_con)-1));
echo $s_con[$banner_no];
?>

Save it as random.php or whatever you like (remember to give .php extension) Now creating random_ads.txt files (for database) and put a sample code on there:

<center>I’m center!</center>
~
<b>I’m bold!!! for freeeeeeeeeeeee</b>
~
I’m adsense ads
~
I’m short news!
~
I’m paid ads!!! hooray!

You can write html code or php code on database file if you’re creative you can put images/flash on it. Now put this both files on same directory on your hosting and embed it using include command into your website page.

Refresh your page to see ads rotated or you can use auto refresh meta

<meta http-equiv=”refresh” content=”180“>

180 value are in milliseconds you can change it to fit your need.

See what you have now 😀

Similar Posts:

Related Search Terms:

    Digg Del.icio.us StumbleUpon Reddit Twitter RSS

If you're new here, you may want to subscribe to my RSS feed. You may copy or publish this article to your blog or other site as long you give credit link back to this site article. Thanks for visiting my blog!