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
https://forums.phpfreaks.com/topic/142669-linking-thumbnails-to-fullsize-images/
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 />"; 
} 

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.