Topic: Pass imagename to html

I would like to give viewers of my gallery an opportunity to make a comment on a particular picture. I'm using PHP and MySQL to collect data. In order to make it work, I would like to pass the filename to the database along with the comment. How do I do this? Let me correct that...I need to get the currently visible imagename and pass it to the PHP script.

There must be image specific data attached to each slide, b/c when you right click and open image in new browser it knows which one. How do I access that data?