• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

How to get users screen resolution?

How can I get users screen resolution?
0
wcoka
Asked:
wcoka
  • 2
  • 2
1 Solution
 
dkjariwalaCommented:
You will have to use javascript.

<html>
<head>
<title> screen resolution</title>
</head>
<html>
<body>
<script language="javascript">

document.href= "http://yourserver/yourscript.php?s_ht=" + screen.height + "&s_wit="  + screen.width";

</script>
</html>
Following code will redirect to yourscript.php and pass on screen height and width.

JD
0
 
wcokaAuthor Commented:
but is there any way how to get this directly from PHP?
0
 
dkjariwalaCommented:
No.

PHP running on server side can not talk to clients machine directly. You MUST use javascript or some other tool.

JD
0
 
wcokaAuthor Commented:
Thanks anyway
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now