Jump to content


Getting the Screen Width

  • This topic is locked This topic is locked
1 reply to this topic

#1 Pedro999

  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 24 July 2013 - 11:38 AM

Done various searches to find out out to get the screen width. Need to do this to set the width and scrollable height of a table. Mostly, people talk about using javascript to set a cookie. Am I on to a loser here? Occurs that the user may not have cookies set. Also, in my implementation of apache/google chrome get an access error when trying to do (code example from the web):


if(isset($_COOKIE['screenresolution'])) {
 //cookie found!
 $screenres = $_COOKIE['screenresolution'];
} else {
 //cookie is not found, so set it with JavaScript
 <script language="javascript">
 function writeCookie() {
  var enddate = new Date("December 31, 2060");
  document.cookie = "screenresolution="+ screen.width +"x"+ screen.height + ";expires=" + enddate.toGMTString();
  window.location.replace("<?= $_SERVER['PHP_SELF'] .'?'.$_SERVER['QUERY_STRING']  ?>");
Access forbidden!

You don't have permission to access the requested object. It is either read-protected or not readable by the server.

If you think this is a server error, please contact the webmaster.

Error 403

#2 trq

  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 24 July 2013 - 11:42 AM

Three things.

1) Does the color you have chosen to post your code in really seem helpful? No.
2) The topic of your question is not related to PHP.
3) Your post seems completely unrelated to your subject.

Try again.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users