This might look a bit strange because I haven't slept for 3 days now but i promised to finish the scripts today while i am kind of a exhausted beginner huh. I have a loop showing pictures, below every picture is a link. When you click it, the popup with add comment form shows up. But actually I have problems to save the comments to database because I don't know how to transfer variables. I will show you this in a simple pseudo-code:
while(lets_say_50){
$x = picture;
echo $x;
echo "<a href>links opening popup with comment form</a>
<div id='popup'>
<form>
<textarea> some comment </textarea>
<input type='submit' method='post'>
</form>
</div>"
}
if(isset($_POST['submit'])){
//here i want to get $x value from above, but it must be exactly the one from the actual loop turn.
//whatever i do, it always gives me the $x from the last picture...
}