i have created an image upload page in my web site which stores the images on the server using php. i now need to get the images to display on a different page. here is the code i have used to set a variable to the file directory

// the new thumbnail image will be placed in images/thumbs/ folder
// call the function that will create the thumbnail. The function will get as parameters
//the image name, the thumbnail name and the width and height desired for the thumbnail
}} }}

i now need to be able to display the uploaded in=mages on a different page for the user to be able to view what they have uploaded. i have got the images to show a preview on the first page by using this code

if(isset($_POST) && !$errors)
echo "<h5>Thumbnail created Successfully!</h5>";
echo '<img src="'.$thumb_name.'">';


i thought i would be able to use img src line of code to display the images on a different page but this has not worked. I know this is probably the wrong wat hence the reason i am not getting the images displayed.

it would be much appreciated if someone could help me out with this code. this is all need to fix for the site to be finished and uploaded. i have tried to research this myself but have had no joy.

10 Years
Discussion Span
Last Post by mwasif

Variable $thumb_name exists only in the current page, on any other page this variable will be null. To show the image on any other page, you need to save this location in database or file. And on other page, get the image path from database/file and display it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.