How can i detect the mobile users screen size using php? I know it has something to do with UA,but please anyone help me.
how to detect mobile screen size
Collapse
X
-
try searching on Developer's Home - Tutorials and Articles for SMS, WML, WMLScript, WAP 2.0, XHTML MP, WCSS/WAP CSS i read it a while ago but dont remember a thing xDPHP Code:$("#mfreak").find(".head brain").clone();
Code:[|||___________________________] : 5%
Code:Memory limit reached, unable to complete operation.
Code:Try using a super uber strong mega computer to reach at least 10%.
-
PHP Code:<script type="text/javascript">document.write(screen.width+'x'+screen.height);</script>
www.inbuzunar.mobi - Your mobile portal pocket
Comment
-
PHP Code:<?php
if(isset($HTTP_COOKIE_VARS["users_resolution"]))
$screen_res = $HTTP_COOKIE_VARS["users_resolution"];
else //means cookie is not found set it using Javascript
{
?>
<script language="javascript">
<!--
writeCookie();
function writeCookie()
{
var today = new Date();
var the_date = new Date("December 31, 2023");
var the_cookie_date = the_date.toGMTString();
var the_cookie = "users_resolution="+ screen.width +"x"+ screen.height;
var the_cookie = the_cookie + ";expires=" + the_cookie_date;
document.cookie=the_cookie
}
//-->
</script>
<?
}
echo "Your screen resolution is set at ". $screen_res;
?>Last edited by metulj; 17.11.11, 06:06.
Comment
Comment