473,813 Members | 4,122 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Screen Res Question

Guys

Is there a way to capture via an environment variable the users screen res

Steve

Oct 23 '07 #1
8 1385
On Oct 23, 10:46 am, "Steve Ray" <nocha...@all.c omwrote:
Guys

Is there a way to capture via an environment variable the users screen res

Steve
PHP runs on the server -- so the answer is no.

Try Javascript.

Oct 23 '07 #2
..oO(ZeldorBlat )
>On Oct 23, 10:46 am, "Steve Ray" <nocha...@all.c omwrote:
>>
Is there a way to capture via an environment variable the users screen res
PHP runs on the server -- so the answer is no.

Try Javascript.
And then the question is - why?

Micha
Oct 23 '07 #3
Not in PHP (it runs on the server), but you can with Javascript.

See: http://www.pageresource.com/jscript/jscreen.htm

Charles...

"Steve Ray" <no******@all.c omwrote in message
news:ff******** **@north.jnrs.j a.net...
Guys

Is there a way to capture via an environment variable the users screen res

Steve

Oct 23 '07 #4
..oO(Sanders Kaufman)
>"Michael Fesser" <ne*****@gmx.de wrote in message
news:jj******* *************** **********@4ax. com...
>And then the question is - why?

The response pre-answers your question - because PHP runs on the server.
My "Why" was meant as a response to "capture ... the users screen res".

Micha
Oct 23 '07 #5
On Tue, 23 Oct 2007 15:46:23 +0100, in comp.lang.php "Steve Ray"
<no******@all.c om>
<ff**********@n orth.jnrs.ja.ne twrote:
>| Guys
|
| Is there a way to capture via an environment variable the users screen res
|
| Steve
PHP knows nothing about the browser so you would need to use
Javascript to query the browsers viewport dimensions.

That being said, I may have a screen with its resolution set to
2048x1536 but the browser is resized to 500x300. How are you going to
handle that situation?

Do a google on html + fluid design
-- -------------------------------------------------------------
jn******@yourpa ntsyahoo.com.au : Remove your pants to reply
-- -------------------------------------------------------------
Oct 24 '07 #6
"Michael Fesser" <ne*****@gmx.de wrote in message
news:0a******** *************** *********@4ax.c om...
.oO(Sanders Kaufman)
>>"Michael Fesser" <ne*****@gmx.de wrote in message
news:jj****** *************** ***********@4ax .com...
>>And then the question is - why?

The response pre-answers your question - because PHP runs on the server.

My "Why" was meant as a response to "capture ... the users screen res".
Wow, you gotta know this one.
In one old app, I checked that setting because I knew some OLD people who
use 640x480 would be on the site.
In the current one, I'm checking it to see if they're coming at me with a
PDA or Cell Phone.
(I totally gave up on just using the server user agent.)
Oct 24 '07 #7
..oO(Sanders Kaufman)
>"Michael Fesser" <ne*****@gmx.de wrote in message
news:0a******* *************** **********@4ax. com...
>>
My "Why" was meant as a response to "capture ... the users screen res".

Wow, you gotta know this one.
In one old app, I checked that setting because I knew some OLD people who
use 640x480 would be on the site.
What does the screen res tell you about the size of the browser window
and its viewport? Exactly nothing.
>In the current one, I'm checking it to see if they're coming at me with a
PDA or Cell Phone.
(I totally gave up on just using the server user agent.)
I don't do any sniffing at all. I write flexible HTML and if I want to
improve the appearance on PDAs (until now it wasn't really necessary),
I could add another stylesheet with media type 'handheld'. For older PDA
browsers I could also add a simple stylesheet switcher just in case they
don't support that media type.

There's almost always a better way than browser or screen res sniffing.

Micha
Oct 25 '07 #8
"Michael Fesser" <ne*****@gmx.de wrote in message
news:5a******** *************** *********@4ax.c om...
.oO(Sanders Kaufman)
>>In one old app, I checked that setting because I knew some OLD people who
use 640x480 would be on the site.

What does the screen res tell you about the size of the browser window
and its viewport? Exactly nothing.
(You're really in tantrum mode today, aintcha?)

For one thing - it tells you that the viewable browser window maxes out at
640x480.
I don't do any sniffing at all. I write flexible HTML and if I want to
improve the appearance on PDAs (until now it wasn't really necessary),
Wow - HTML that looks as good on a big-screen tv as it does on a cell-phone.
You should patent that process.
Oct 25 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
105849
by: Dave | last post by:
Hi, I have done some research, trying to Clear The Screen in java code. The first option was the obv: system.out.print("\n\n\n\n\n\n\n\n\n\n\n\n"); then i heard about this method: System.out.print((char)27 + "[2J");
8
15830
by: Els | last post by:
Hi, i have the following script in the head of my document: <script language="Javascript"> <!-- // *********************************************** // AUTHOR: WWW.CGISCRIPT.NET, LLC // URL: http://www.cgiscript.net // Use the script, just leave this message intact. // Download your FREE CGI/Perl Scripts today! // ( http://www.cgiscript.net/scripts.htm )
8
3467
by: gregory_may | last post by:
Is there a way to grab a "Screen Shot" that includes "Tool Tips"? I saw this code someplace, cant remember where. But it doesnt grab "Tool Tips". Is there a better way to do this in .net? Thanks! Private Declare Function CreateDC Lib "gdi32" Alias "CreateDCA" (ByVal lpDriverName As String, ByVal lpDeviceName As String, ByVal lpOutput As String, ByVal lpInitData As String) As Integer
6
5622
by: Tony Liu | last post by:
Hi, when switched to the full screen mode in VS.NET IDE, is there any way to hide the main menu bar? Thanks Tony
7
4271
by: alr288 | last post by:
Hello All, I recognize that this question has already brought about some debate so I am going to ask as a specific question as I can. I am currently try to create a cross platfrom screen parser in C. I was able to find C code that grabs the pointer to the array of screen pixels in memory for the OS X platform: PixMap pixMap; GetQDGlobalsScreenBits((BitMap*)&pixMap);
5
1536
by: TD | last post by:
This question is off topic but you folks have the answers. I do Access development work at clients offices using my laptop. I want to purchase a new laptop but I am wondering if I need a laptop that offers more screen resolutions than just 1024x768 anf 800x600? In retrospec my current laptop is set at 1024x768 and I've never changed it but I don't want to box myself in with a machine that does just the 1024x768 anf 800x600 resolutions if...
10
1753
by: Kenneth Lantrip | last post by:
My question is: Is there a generally accepted way to clear the screen and perhaps move the cursor to a new location (other than newline) for the next printf in standard c? What about ANSI control codes? Are those standard across most platforms? Or is that just for PC/MAC based computers? Anyone know where I can see a list of ANSI codes? Please enlighten me, thanks for your time.
31
4208
by: melinama | last post by:
Hello, I've looked through alt.html and this group for an answer to my question. However, I found only cranky arguments with, occasionally, bits of hard-to-understand code - out of context - each of which is slammed by the next people along in the thread. So I'm afraid to ask this but I need to know!...
4
1514
by: Annalyzer | last post by:
Not sure if this is the right place to post this question because it is not specific to html or css and it's more of an opinion question than a technical one so feel free to move it if there is a better place. Over the past few months, I have been tracking stats on our website - http://www.ucancap.org - and find that less than 10% of our viewers use a screen resolution lower than 1024x768. My question is this: Is there a generally accepted...
0
9734
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9607
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10665
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10406
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10139
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9221
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5704
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3881
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.