Ok - lets say you have two pages:
index.php
popup.php
you have a link on index.php that you want to popup and display some session variables:
<A HREF="javascript:void(0)" ONCLICK="window.open('/popup.php','','width=600,height=400,directories=no,location=no,menubar=no,scrollbar=no,status=no,toolbar=no,resizable=no,screenX=200,screenY=200,top=200,left=200');">Link</A>
Now, there are two ways of doing this - if they are plain variables you would write it as:
echo "<A HREF=\"javascript:void(0)\" ONCLICK=\"window.open('/popup.php?var1=$var1&var2=$var2,'','width=600,height=400,directories=no,location=no,menubar=no,scrollbar=no,status=no,toolbar=no,resizable=no,screenX=200,screenY=200,top=200,left=200');\">Link</A>";
That would pass the variables to the page popup.php via the url where you can then echo them using <?php echo $var1; echo $var2; ?>
If they are session variables you don't have to do that, you write the window.open as the first example and then echo them as stated above or below.
For echoing in html it's simple. Just name your file with a .php extention and it will be as so:
<HTML>
<HEAD>
<TITLE><?php echo $var1; ?></TITLE>
<BODY>
Hello <?php echo $var2; ?>
</BODY>
</HTML>
if $var1 = Foobar! and $var2 = Joe that would output a page that said "Hello Joe" with the title "FooBar!"
JMJimmy