derek34
Jan 1st 2008, 6:30 pm
Hi
I am having trouble getting a simple image randomization script to work. When I test it on my own computer it works fine.
However, when I upload all the photos and script to my web server, it does not work.
Any idea why it won't work on the web server?
Here's the script:
<?php
$images = array(
'DSC_0097.jpg',
'DSC_098.jpg',
'..........' //rest of images
);
header('Content-Type: image/jpeg');
readfile($images[array_rand($images)]);
?>
That is an external script that gets called like this:
<img src="images/lanoct/image.php" />
Any help is appreciated as always.
Thanks
- Derek
I am having trouble getting a simple image randomization script to work. When I test it on my own computer it works fine.
However, when I upload all the photos and script to my web server, it does not work.
Any idea why it won't work on the web server?
Here's the script:
<?php
$images = array(
'DSC_0097.jpg',
'DSC_098.jpg',
'..........' //rest of images
);
header('Content-Type: image/jpeg');
readfile($images[array_rand($images)]);
?>
That is an external script that gets called like this:
<img src="images/lanoct/image.php" />
Any help is appreciated as always.
Thanks
- Derek