#random images example
#this is your file
$file = images.txt;
#open the file
$openFile = file($file);
#generate a random number
srand((double)microtime()*100);
#get one of the entries in the file
$random_image = $openFile[array_rand($openFile)]; #display
the entry
echo img src
with PHP, but am working to fix that.
I've searched high and low for an answer to this question
and so far
no solution has presented itself. I have a script to
populate my web
page with random images:
?php
#random images example
#this is your file
$file = images.txt;
#open
Jared Williams wrote:
Hi,
Just unset the ones you've picked
?php
#random images example
#this is your file
$file = images.txt;
#open the file
$openFile = file($file);
#generate a random number
srand((double)microtime()*100);
#get one of the entries in the file
for ($i = 0
Silvio Porcellana [tradeOver] wrote:
code
$file = images.txt;
$openFile = file($file);
$num_images = 10;
# don't need this is PHP 4.2.0
srand((float) microtime() * 1000);
$random_keys = array_rand($openFile, $num_images);
foreach
choices.
-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Friday, December 16, 2005 2:47 AM
To: php-general@lists.php.net
Subject: Re: [PHP] Random Images with no duplicates?
On Thu, Dec 15, 2005 at 08:45:33PM -0800, Mike Rondeau wrote:
Hi,
I'm still very
Hi,
Just unset the ones you've picked
?php
#random images example
#this is your file
$file = images.txt;
#open the file
$openFile = file($file);
#generate a random number
srand((double)microtime()*100);
#get one of the entries in the file
for ($i = 0; $i 10; ++$i)
{
$r
Hi,
I'm still very green with PHP, but am working to fix that.
I've searched high and low for an answer to this question and so far
no solution has presented itself. I have a script to populate my web page
with random images:
?php
#random images example
#this is your file
$file = images.txt
Hi,
I'm still very green with PHP, but am working to fix that.
I've searched high and low for an answer to this question and so far
no solution has presented itself. I have a script to populate my web page
with random images:
?php
#random images example
#this is your file
$file = images.txt
presented itself. I have a script to populate my web page
with random images:
?php
#random images example
#this is your file
$file = images.txt;
#open the file
$openFile = file($file);
#generate a random number
srand((double)microtime()*100);
#get one of the entries in the file
:
?php
#random images example
#this is your file
$file = images.txt;
#open the file
$openFile = file($file);
#generate a random number
srand((double)microtime()*100);
#get one of the entries in the file
$random_image = $openFile[array_rand($openFile)];
#display the entry
echo img src
I'm trying to set it up so that a random image from either a mysql table
or a text file list is displayed on a page each time a user goes to it.
I'm a little stumped as to how to do this with phpany suggestions?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Tom!
Here's one way:
I named all of the images to display 1.jpg - 7.jpg
This code is at the top of the page:
?$jpg = rand(1,7);?
I have this code where I want the image to appear:
img src=img/?print $jpg;?.jpg width=632 height=422
HTH
VW
Quoting Tom Ray [EMAIL PROTECTED]:
### I'm trying
I'm trying to set it up so that a random image from either a mysql
table
or a text file list is displayed on a page each time a user goes to
it.
I'm a little stumped as to how to do this with phpany suggestions?
What do you have so far?
---John W. Holmes...
PHP Architect - A monthly
This one time, at band camp,
V Dub [EMAIL PROTECTED] wrote:
Tom!
Here's one way:
or you could do something like this...
Simply set the image directory and fire it up
?php
// just so we know it is broken
error_reporting(E_ALL);
// set the images directory
$imgDir = './images';
Hi there. I have s a php page that randomly grabs an image's path from a db
field and displays it on my php page. My problem is that sometimes when I
refresh the image won't display. So I guess you can say I'm getting
intermittent images...sometimes it displays and sometimes not. I've checked
all
15 matches
Mail list logo