well,PHP can help you do this by use the tag <a href>
here`s an example:
PHP Code:
$a="you can add every thing here,like var";
echo "<a href='?varname=$a'>picture link</a>";
wehn u click on that link,it will give the variable to the current page
DId this match ur question?i`m not good at English at all,if it went wrong,can u make it clearliere,thx