| | #1 |
| ConversionCrafting.com War Room Member Join Date: 2007 Location: Springfield, Mo
Posts: 973
Thanks: 346
Thanked 678 Times in 242 Posts
|
Hey guys, I've Googled, not much of a programmer. I'm looking for a simple PHP or javascript code that I can place on a site to rotate one image 25% of the time and the second 75% of the time. I would assume this is just a few simple lines of code, maybe I'm wrong. Any links to something like this or ideas? Thanks in advance! -Scott |
|
Over $30 Million In Marketing Data And A Decade Of Consistently Generating Breakthrough Results - Ask How My Unique Approach To Copy Typically Outsells Traditional Ads By Up To 29x Or More...
| |
| |
| | #2 |
| Peaceful Warrior War Room Member Join Date: 2009 Location: Calgary
Posts: 277
Thanks: 16
Thanked 106 Times in 63 Posts
|
The following is based on randomization, which means it is not at all guaranteed to be 25% and 75% in the short term. But over time the 1-in-4 odds will even out. $random_images = array(); $random_images[] = 'imageA.jpg'; $random_images[] = 'imageA.jpg'; $random_images[] = 'imageA.jpg'; $random_images[] = 'imageB.jpg'; // this is the ~25% file name shuffle($random_images); // randomize the order of the above files echo '<img src="path/to/images/'.$random_images[0].'" />'; // print out the first random one -Ryan |
| FREE WSO: Protect and Automatically Deliver Your Digital Products Ask the Internet Marketing Geek <-- Happy to help with technical challenges MiniSiteMaker.org <-- Free software to make your mini-sites fast and easy | |
| |
| The Following User Says Thank You to theIMgeek For This Useful Post: |
| | #3 |
| ConversionCrafting.com War Room Member Join Date: 2007 Location: Springfield, Mo
Posts: 973
Thanks: 346
Thanked 678 Times in 242 Posts
|
Sweet! Thanks Ryan. Going to try it out now. -Scott |
|
Over $30 Million In Marketing Data And A Decade Of Consistently Generating Breakthrough Results - Ask How My Unique Approach To Copy Typically Outsells Traditional Ads By Up To 29x Or More...
| |
| |
| | #4 |
| A rat after money... War Room Member Join Date: 2009 Location: Inside a cheese...
Posts: 770
Thanks: 365
Thanked 80 Times in 68 Posts
| |
| |
|
| Bookmarks |
| Tags |
| rotation, script, simple |
| |