Initially, as can be seen in this unsuccessful attempt: Undefined index error when sending variable from jquery to php and this unsuccessful attempt:Passing Jquery variable to php within a modal
I was trying to pass a variable from php, to jquery and back to php.
Basically I am generating images form a database in a php loop. When the user selects an image, I want the id of that image to be passed to the modal so that I can query the database again (based on that id) and get more information.
Is there another way of doing this other than the methods outlined in the posts above. For some reason those do not return the result.
The difference between Send PHP variable value to JavaScript popup window in same page and my question is that I want it as a heading.. and as a variable so I can query the database again. I am not using this to input values into a form