simpleModal - parsing variable from original php to modal popup

simpleModal - parsing variable from original php to modal popup

Hello,

I have a the SimpleModal running on a php page, and on said php page, a varaible is defined; e.g. $var = "John";

and then the usual gubbings for simpleModal, which calls modal_output.php - the file generating the output for the modal popup.

I need to get that $var into this popup, so the popup can read:

"blaa blaa John"

This should be simple, I thought - but I can't parse it through _SESSION, or any method I try. I even tried hacking it into:

$.get("contact_modal.php", function(data){

to read
$.get("contact_modal.php?var=<?php echo $var ?>", function(data){

but that breaks the js

Is there anyway I can parse the variable from the original page into the modal popup page?

I'm stumped.

Many thanks in advance,
Rob