I'm trying to build a PHP page that a) detects the users screen size and either echo's a URL (download document) if the screen size is MOBILE or includes a php page if COMPUTER.
That being said I cannot seem to find the right match... I saw one done with PHP while storing cookies, but that's not practical as you need to reload the page to store cookies before the page reacts properly.
Here is what I've been trying:
<?php
$callget_res_page_name = $REQUEST_URI;
$GLOBALS[callget_res_page_name] = $callget_res_page_name;
?>
<script>
if (document.write("+screen.width+") > 768) {
$("#mailDiv").load('menu.html');
}
else {
document.write('<h1><a href='Menu.pdf'>Download the PDF Menu</a</h1>');
}
</script>
Any thoughts on what I'm doing wrong or how else I could attempt to accomplish this?