Loans - PrePaid Credit Cards - Modded Xbox - Starting Over - McDonalds

PDA

View Full Version : PHP image randomization problems


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

selling vcc
Jan 2nd 2008, 12:11 am
I guess that you are testing the script on windows and uploading it to a linux server !

Check the images directories/files permissions

nico_swd
Jan 2nd 2008, 1:57 am
Are the images in images/lanoct/??

And what do you see when you directly browse to the image.php file? If it's blank, see the source code of it (right click and "view source code"), and see if you get a specific error there.