Passing an echo value to another page via JavaScript popup link

I inherited a script that uses JavaScript to open a popup window (a php file) hosted on another website. At the same time, it’s supposed to pass an echo value, but I can’t figure out how to echo it.

For example, let’s say you’re surfing MySite2/World - where $MySiteID = ‘PX’ - and you click the following link:

<a href="javascript:;" onClick="MM_openBrWindow('<?php echo $MySiteID; ?>','IRCAN','scrollbars=yes,resizable=yes,width=175,height=250')">PopUp</a>

When World_Children/Can.php opens, I want it to inherit the $MySiteID value (PX).

Or if I visited MySite3/World - $MySiteID = ‘Three’ - and clicked a similar link, then the same popup (World_Children/Can.php) would open. But this time, it would assume the value $MySiteID = ‘Three.’

So it looks like my JavaScript link is already set up to do just that. I just don’t understand what I have to do on the other page (Can.php) to copy and display that value.


It does look like your link is set up to do what you want. In your Can.php file, that value will be accessible using $_GET[‘MySiteID’]

echo $_GET['MySiteID'];