When you receive the uploaded photo, you are going to store that somewhere on the server. Likewise, when you make the thumbnail, you are going to store that on the server too.
And let's say that you store the original image (the full size image) in:
/path/to/your/website/images
And let's say that you store the thumbnail in:
/path/to/your/website/thumbs
Finally, let's say that you know the following variables:
$original - this is the filename of the original file in the images directory
$thumb - this is the filename of the thumb in the thumbs directory
You could make the link by saying:
$link = "<a href=\"http://www.yoursite.com/images/" . $original . "\">";
$link .= "<img src=\"\http://www.yoursite.com/thumbs/" . $thumb . "\" border=0>";
$link .= "</a>";