|
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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 | ![]() | 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 |
|
|
|
|
![]() | ![]() | ![]() |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| phpLinkBid Directory Script - 20% Off All Orders - Exclusive Coupon Code SUNSHINE | Tekime | Other Offers & Requests | 0 | 09-19-2008 05:06 PM |
| Php Basics | Retire at 21 | Coding Tutorials | 1 | 08-29-2008 10:20 AM |
| PHP e-commerce script, online shop | chetan1 | General Discussion | 0 | 05-02-2008 07:39 AM |
| [SALE] Well Tested Script | pink.aquarian | Other Offers & Requests | 1 | 10-04-2006 09:48 AM |