|
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
PHP Tutorial - Ad Rotation ScriptThis is a discussion on PHP Tutorial - Ad Rotation Script within the General Development forums. Topic: With this script, you will be able to have 3 banners/ads in a rotation showing one more than the ... |
![]() |
![]() |
|
![]() |
LinkBack | Thread Tools | ![]() | Search this Thread | ![]() | Display Modes | ![]() |
|
|
#1 (permalink) |
|
With this script, you will be able to have 3 banners/ads in a rotation showing one more than the other.
First Banner we want it to display 70%. Second Banner we want to display 20%. Third Banner we want to display 10% . Code: <?php // random number 1 - 100 $result_random=rand(1, 100); // if result less than or equal 70, display ad 1 (70%) if($result_random<=70){ echo "Ad 1 link"; } // if result less than or equal 90, display ad 2 (20%) elseif($result_random<=90){ echo "Ad 2 link"; } // if result less than or equal 100, display ad 3 (10%) elseif($result_random<=100){ echo "Ad 3 link"; } ?> _________________ banner sign trade show display |
|
|
|
|