I am trying to test something out, and pass a javascript variable of screen size to PHP to have PHP determine table widths. (I am bored)
I have the javascript that will detect screen resolution but unfortunately I do not know how to get the results to go into a "hidden" input field to pass to PHP.
Here is the code
<script language="JavaScript">
<!-- This Script was created by Raphael. Visit his Site at: http://www.nr1webresource.com -->
if (screen.width <= 640)
document.write("<CENTER><STRONG> Your current resolution is "+screen.width+""+screen.height+".</STRONG><BR> This Web Site is optimized for a Screen Resolution of 800600 (or better)<BR><STRONG><u>If Possible, please modify</u></STRONG>.</CENTER>")
else {// (screen.width >= 641)
document.write("<CENTER><STRONG> Your current resolution is "+screen.width+"*"+screen.height+".</STRONG><BR> You are using the recommended Screen Resolution for this site!</CENTER>")
}
// -->
</script>
What I want is something like....
<input type="hidden" name="resolution" value="print resolution here">
I dont know much about JavaScript so any help or direction would be greatly appreciated.
Cheers
John