D
Daniel Rudy
Consider the following code:
<?php
if (isset($_POST['width']) && isset($_POST['height']))
{
// output the geometry variables
print "Window width is: ". $_POST['width'] ."<br>\n";
print "Window height is: ". $_POST['height'] ."<br>\n";
}
else
{
print <<<HTMLBLOCK
<form name="screensize" method="POST" action="$_SERVER[PHP_SELF]">
<input type="hidden" name="width" value="">
<input type="hidden" name="height" value="">
</form>
<script language="javascript">
var myform = document.screensize;
myform.width.value = screen.width;
myform.height.value = screen.height;
myform.submit();
</script>
HTMLBLOCK;
}
?>
This code renders as the following in a web browser:
<form name="screensize" method="POST" action="/test/test.php">
<input type="hidden" name="width" value="">
<input type="hidden" name="height" value="">
</form>
<script language="javascript">
var myform = document.screensize;
myform.width.value = screen.width; <-- Line 8
myform.height.value = screen.height;
myform.submit();
</script>
Here's the problem. In IE7, this works just fine. But in Seamonkey
1.1.8, it fails (blank page). The error console gives the following
error: myform has ho properties (line 8). I haven't tried it in other
browsers. I have exhausted my reference documentation, and I couldn't
find an answer on Google either. Everything I found says this should
work, but it's not. Any ideas?
<?php
if (isset($_POST['width']) && isset($_POST['height']))
{
// output the geometry variables
print "Window width is: ". $_POST['width'] ."<br>\n";
print "Window height is: ". $_POST['height'] ."<br>\n";
}
else
{
print <<<HTMLBLOCK
<form name="screensize" method="POST" action="$_SERVER[PHP_SELF]">
<input type="hidden" name="width" value="">
<input type="hidden" name="height" value="">
</form>
<script language="javascript">
var myform = document.screensize;
myform.width.value = screen.width;
myform.height.value = screen.height;
myform.submit();
</script>
HTMLBLOCK;
}
?>
This code renders as the following in a web browser:
<form name="screensize" method="POST" action="/test/test.php">
<input type="hidden" name="width" value="">
<input type="hidden" name="height" value="">
</form>
<script language="javascript">
var myform = document.screensize;
myform.width.value = screen.width; <-- Line 8
myform.height.value = screen.height;
myform.submit();
</script>
Here's the problem. In IE7, this works just fine. But in Seamonkey
1.1.8, it fails (blank page). The error console gives the following
error: myform has ho properties (line 8). I haven't tried it in other
browsers. I have exhausted my reference documentation, and I couldn't
find an answer on Google either. Everything I found says this should
work, but it's not. Any ideas?