Yes, this question is pretty much exactly like Javascript screen width/height to PHP But I can't get the answers (to that question or to several similar ones) to work in the context described below. That's probably due to my very, very limited knowledge of php, and next-to-nothing knowledge of js (I've just cut-and-pasted some js stuff that I didn't understand, and fiddled with it until it "just worked").
The php I have now just hard-codes the height for an <iframe>...
<?php
Blah; blah; blah;
echo ' <iframe align="middle" width="99%" height="768"', "\n";
echo $some_more_stuff_to_finish_iframe_tag, "\n";
?>
But what I really want is something like...
<?php
global $screenheight;
$frameheight = $screenheight-100;
Blah; blah; blah;
echo ' <iframe align="middle" width="99%" height="';
echo $frameheight,'"', "\n";
echo $some_more_stuff_to_finish_iframe_tag, "\n";
?>
By the way, the reason for php to echo that iframe tag is that its src= attribute has to be dynamically constructed.
And I don't suppose that global $screenheight; I've illustrated is actually the php-side of the correct js-to-php mechanism. I just put it there as a "place-holder", so to speak. So, what is the correct mechanism and syntax -- both the js and php sides -- to accomplish this?