User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 422,405 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,868 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 322 | Replies: 1
Reply
Join Date: Feb 2008
Posts: 297
Reputation: kevin wood is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz in Training

Question displaying images

  #1  
Mar 14th, 2008
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
$thumb_name='image/thumbs/thumb_'.$image_name;
// 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
$thumb=make_thumb($newname,$thumb_name,WIDTH,HEIGHT);
}} }}

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['Submit']) && !$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.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2007
Posts: 113
Reputation: mwasif is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 13
mwasif mwasif is offline Offline
Junior Poster

Re: displaying images

  #2  
Mar 14th, 2008
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.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MySQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

All times are GMT -4. The time now is 9:14 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC