Posted by Niklas Schφnberg on 06/29/05 05:53
mbasil7 wrote:
> Hi at all!
>
> I want to use a javascript variable in php. The reason is that i want
> to know the client's screen resolution.
How about this:
--- Code ---
<?php
if (!isset($width) || !isset($height))
echo "<script type='text/javascript'>
document.location='index.php?width='+screen.width+'&height='+screen.height;
</script>";
echo "$width X $height";
?>
--- End Code ---
I don't have the ability to test it right now, so don't bash me too much
if it doesn't work. However the idea should be pretty sound.
Navigation:
[Reply to this message]
|