I have made a simple PHP image gallery where I save each users pictures in a folder with their usernames.
Like this for example:
images\USERNAME\originalpicture.jpg
images\USERNAME\thumbs\thumb_originalpicture.jpg
To show the users pictures I use a code that shows all files in the folder images\USERNAME\thumbs\
But I have been trying to figure out how to make a link on each thumbnail so they can click on it to see the original picture.
I NEED HELP, can’t figure it out!
<table border="0" width="600">
<tr>
<td>
<? $sessionnavn = $_SESSION['SESS_FIRST_NAME'];
echo '<h1>'.$sessionnavn.'`s album</h1>';
?>
<br>
<?php
$files = glob("images/".$sessionnavn."/thumbs/*.*"); for ($i=0; $i<count($files); $i++) { $num = $files[$i];
echo '<img src="'.$num.'" alt="Opplastet bilde"></a>'." "; } ?>
</td></th>
</table>