Well Peter, I think there's something
you haven't understood well.
First the PHP is executed on the server, and
a HTML document is generated.
Then that document goes over the internet from the server to your browser.
Finally on the browser the javascript contained in the document is executed.
What you could do in your case would be:
1) call a HTML page with a javascript that
get the size of the screen.
2) immediately redirect to your PHP, using document.URL (I think, or something similar), and passing the size of your screen as Vincent said (say, .../myscript.php?h=js_height&w=js_width)
3) In the PHP you request, analyse the size
and do whatever you need to do: if ($w<1024) { do_something(); }
Hope this helps,
Olivier
Peter wrote:
When a page is loading I want a JavaScript to check the screen height and width and then I want those numbers stored in PHP variables.