Multi Coin Faucet List
HOT ! Faucets of the Day
PLAY COUNTER-STRIKE AND EARN BITCOIN [Instant][FaucetHub]
MrBTCFaucet [ 15 sat Every 0 Min ][Instant][FaucetHub]
TreasureBits [ 30 sat Every 4 Min ][Instant][FaucetHub]
ClaimBit [ 25 sat Every 5 Min ][Instant][FaucetHub]
Claimfreebtc [ 20 sat Every 5 Min ][Instant][FaucetHub]
ClaimBTC [ ~ 20 Satoshi Every 5 Min ][Instant][FaucetHub]
Cointiply [ ~ 5000 Satoshi Multiple Tasks - DOGE/BTC ][35000][FaucetHub]
Freek [ ~ 0.2 DOGE EVERY 1 MIN ][Mining Ability][ 1 DOGE ][FaucetHub]

Tutorials

Free banner rotator for website

Simple Banner Rotator with PHP

After release of our first tutorial here :- Banner Rotator Code for Faucets  some of my friend said they are not good in sql thing. So make more simple. Here i am coding same thing again without use of MYSQL. Hope it works for everyone.

Learn How To Make Free PHP Banner Rotator
STEP 1 :-

First make a php page and add this function and include that page in same page where you want to display ads , or add this function in your existing function.php file.

#FUNCTION FOR BANNER ROTATOR#
function bannerRot($file){
  $adfile = file_get_contents($file);
  $adx = explode('~',$adfile);
  $countarray = count($adx);
  $randomad = rand(0,$countarray-1);
  return $adx[$randomad];
}
#FUNCTION FOR BANNER ROTATOR#

 

STEP 2 :-

Now make a .txt file with anyname u like, i will suggest to make .txt files with adsizes so that you can understand at the time of edit where to ad code.

So best is to make .txt files like this

728×90.txt

468×60.txt

Add code in those files like this. An example given below

<div style="border:1px solid #000;width:468px;height:60px;text-align:center;line-height:60px;background-color:#000;color:#fff;">
BANNER ADS ONE
</div>

~

<div style="border:1px solid #000;width:468px;height:60px;text-align:center;line-height:60px;background-color:#735e05;color:#fff;">
BANNER ADS TWO
</div>

~

<div style="border:1px solid #000;width:468px;height:60px;text-align:center;line-height:60px;background-color:#320add;color:#fff;">
BANNER ADS THREE
</div>

-> ~ this simbol is important to separate many codes.

STEP 3 :-

Use this code where ever you want to display ads.

<?php 
echo bannerRot('728x90.txt');
?>

The above code is an example to display random ad from 728×90.txt file. The more codes will rotate codes randomly.

I hope you like our tutorials and use them in your website. Enjoy you time and share our blog in your friends.

2 Comments

  1. Ruben

    Thanks for this usefull peace of code. I am using it to display banner rotator on my blog.

Comments are Closed

Theme by Anders Norén