Jump to content

Linking thumbnails to fullsize images.


nublet

Recommended Posts

Hi i've been trying to make a simple image host with php. I've been having problems with linking the thumbnails to the fullsize images though. Im displaying the thumbnail images with this code

 

<?php
include("config.inc.php");

$result = mysql_query("SELECT * FROM gallery_photos");
While($row = mysql_fetch_array($result)){
echo "<img src='photos/tb_" . $row['photo_filename'] . "' />\n"; 
} 

?>

 

When an image is uploaded it is saved to a photos folder as well as a thumbnail version of the image with tb_ at the begining of the file name. File id, date and time are saved into an sql database.

 

Could anyone please help me with this?

 

Link to comment
Share on other sites

<?php
   include("config.inc.php");

$result = mysql_query("SELECT * FROM gallery_photos");
While($row = mysql_fetch_array($result)){
echo "<a href='photos/" . $row['photo_filename'] . "'><img src='photos/tb_" . $row['photo_filename'] . "' border='0' /></a><br />"; 
} 

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.