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)]); ?> PHP: That is an external script that gets called like this: <img src="images/lanoct/image.php" /> PHP: Any help is appreciated as always. Thanks - Derek
I guess that you are testing the script on windows and uploading it to a linux server ! Check the images directories/files permissions
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.