![]() |
![]() |
|
||||
|
PHP include help!
Ok i have this working script now thanks to a member here:
Quote: <? //populate following array with image urls $images = Array( "http://www.xninelivesx.com/header_1.jpg", "http://www.xninelivesx.com/header_2.jpg", "http://www.xninelivesx.com/header_3.jpg", "http://www.xninelivesx.com/header_4.jpg", "http://www.xninelivesx.com/header_5.jpg" ); $random_image = $images[rand(0,count($images)-1)]; echo "<img src=\"$random_image\">"; ?> that works perfect.. now i need to use it as an include on my forums.. please give me the right code! thanks, |
|
||||
|
What exactly do you mean? If I got it correctly here's my help:
Remove this code echo "<img src=\"$random_image\">"; and Save your block of code in a filename like randomimage.php. if you wanted to use it as a split test then do this: 1. on the first line put this: <?php include 'randomimage.php' ?> 2. and in an image tag, put this <img alt="random image" src="<php echo $random_image; ?>" /> Hope that will help. Last edited by jun24; 01-23-2009 at 01:20 PM. |
|
||||
|
Now I know how will I tweak that code.
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP include help! | nirose | Programming / Scripts | 0 | 12-28-2008 06:37 AM |
| PHP confusion | Buggy123 | Programming / Scripts | 1 | 10-14-2008 07:46 PM |
| Indian PHP developer | shru_development | Making Money / Main Discussion Forum | 0 | 04-12-2008 09:48 AM |
Products |
This is a revenue share forum |
|
|
![]() |
![]() |
![]() |