Page 1 of 1
Upload images not showing
Posted: Mon May 25, 2009 11:01 pm
by bjstyl2
I have a folder where images get uploaded too but i want to create a php fileto show the array of images from this folder, its a simple web folder and all the images are jpg or gif. The images not not showing. Does anyone know what can cause this?
Also this is on a secure site and I get the warning about secure and unsecure information. Is there a way to fix the images so that this warning is not thrown.
Re: Upload images not showing
Posted: Tue May 26, 2009 1:00 pm
by mikemike
When you say the images are not showing, what do you mean? Are you just going to the folders location in your browser and hoping Apache will show you an index of all the files? If so this will only happen if it's set to do so in your Apache config. If you want to display all of the files in the directory I suggest using the glob function:
Code: Select all
<?php
foreach (glob("*") as $filename) {
echo "<a href=\"$filename\">$filename</a> - size " . filesize($filename) . "<br />\n";
}
?>
The above will generate a list of all files in the current directory and give you their filesize in bytes. You can play with this to produce what you like.
With regards to the warnings about unsecured items. If you're on a secure socket layer (SSL - There is a https:// (note the 's') before the domain in the address bar) then you should only display items from a secure server. If you are displaying images in a format like the following...
Code: Select all
<img src="http://www.example.com/logo.jpg" alt="logo" />
...then you will generate a warning because the logo is not on an SSL.