brax Posted June 6, 2007 Share Posted June 6, 2007 I found random PHP slideshow script... but can't find where PHP can set up an array with n images and one and only one url for each rotatated image... can PHP do this? Or am I stuck with Java? Or what? automated script in html code for image rotate... url link also array has images and url for link automated pulls image and link from array random and non-repeating.... once per page view. Steer this ship. PHP or Java? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/54504-random-image-rotator-php-or-java/ Share on other sites More sharing options...
dbillings Posted June 6, 2007 Share Posted June 6, 2007 Can be done with php yes. Quote Link to comment https://forums.phpfreaks.com/topic/54504-random-image-rotator-php-or-java/#findComment-269581 Share on other sites More sharing options...
brax Posted June 7, 2007 Author Share Posted June 7, 2007 Thanks... Ok... PHP it is. How do you include link to url along with the image... if each image has a different linked url. Isn't this old stuff? Doesn't anyone have any code on this? Let see what you want and we'll trade. Quote Link to comment https://forums.phpfreaks.com/topic/54504-random-image-rotator-php-or-java/#findComment-270354 Share on other sites More sharing options...
Dragen Posted June 7, 2007 Share Posted June 7, 2007 You'd need an array containing all of the images (I think) for example: $images = array(0 => 'myimage.gif', 1 => 'myimage2.gif); Then have a variable which is set at a random number between 0 and the amount in the variable. $no = rand(0, count($images)); Then call the image like this: <?php echo '<img src="' . $images[$no] . '" border="0" width="100" height="100" alt="' . $images[$no] . '" /> ?> This was just made up very quickly so might be completly wrong, but it's what I'd try first... Quote Link to comment https://forums.phpfreaks.com/topic/54504-random-image-rotator-php-or-java/#findComment-270375 Share on other sites More sharing options...
brax Posted June 14, 2007 Author Share Posted June 14, 2007 Uh, yes....? but, how do you connect a web site or web page to the image that is rotating.... that is the real problem. thanks for you time... I really do appreciate it. Quote Link to comment https://forums.phpfreaks.com/topic/54504-random-image-rotator-php-or-java/#findComment-274279 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.