Right to settle this, i have searched etc

I understand the only way to get a users screen res is through javascript, but im not sure how to take those two values and put them into variables?

I have tried the following....

PHP Code:
<?php

$me
=?><input type="text" size="20" name="t1" value="not supported"><?php ;

echo 
$me;

?>


<script>

<!--
function show(){
if (!document.all&&!document.layers)
return
document.t.t1.value=screen.width
document.t.t2.value=screen.height
document.t.t3.value=screen.colorDepth
document.t.t4.value=screen.pixelDepth
}
show()
//-->
</script>