Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to get users screen resolution?

Posted on 2002-06-15
4
Medium Priority
?
228 Views
Last Modified: 2006-11-17
How can I get users screen resolution?
0
Comment
Question by:wcoka
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
dkjariwala earned 120 total points
ID: 7081268
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
 

Author Comment

by:wcoka
ID: 7081282
but is there any way how to get this directly from PHP?
0
 
LVL 5

Expert Comment

by:dkjariwala
ID: 7081356
No.

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

JD
0
 

Author Comment

by:wcoka
ID: 7081358
Thanks anyway
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to implement server side field validation and display customized error messages to the client.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question