hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : Determining Screen Resolution???
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

Determining Screen Resolution???

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 09-09-2002, 01:27 PM
matt2kjones matt2kjones is offline
Web Hosting Master
 
Join Date: Jun 2002
Location: United Kingdom
Posts: 1,236

Determining Screen Resolution???


Ok i have created websites which use iframes, and if you create an iframe that fits 800 x 600 screen resolution, it looks small on higher resolutions because you give a particular iframe a size in pixels.

So i was wondering, is there a way, using php, to find out the screen resolution a user is using??

if so i want to do the following.

if the screen resolution is equal, or less that 800 x 600 resolution, then goto http://www.thedigitaldream.co.uk/lowres/ else, goto http://www.thedigitaldream.co.uk/highres/

if you can do this, can someone please give me the code.

Thanx so much in advance.

Matt

Reply With Quote


Sponsored Links
  #2  
Old 09-09-2002, 06:45 PM
Rich2k Rich2k is offline
Web Hosting Master
 
Join Date: May 2002
Location: UK
Posts: 2,994
Nope you would have to do this in JavaScript.

I've never come across a method of doing this in PHP (that is not to say that it isn't possible though!)

Reply With Quote
  #3  
Old 09-11-2002, 12:17 AM
Alturus Alturus is offline
Newbie
 
Join Date: Aug 2002
Location: Canada
Posts: 22
It's not possible with PHP. As PHP processes the information before the page gets rendered by the browser (or even sent).

Reply With Quote
Sponsored Links
  #4  
Old 09-14-2002, 07:12 AM
matt2kjones matt2kjones is offline
Web Hosting Master
 
Join Date: Jun 2002
Location: United Kingdom
Posts: 1,236
ok thanx for you info

didn't think it was possible with php as it is server side

not a problem

thanx anyway

Matt

Reply With Quote
  #5  
Old 09-14-2002, 08:00 AM
OwenCK OwenCK is offline
Newbie
 
Join Date: Mar 2002
Posts: 10
You could always size your iframes with percentages instead of pixels.

Reply With Quote
  #6  
Old 09-14-2002, 10:52 AM
Acronym BOY Acronym BOY is offline
Web Hosting Master
 
Join Date: Mar 2002
Location: Westbury, LI NY
Posts: 1,705
Or use CSS and have it dynamcially resize, sort of like this:

www.advancedcoolingsolution.net

Reply With Quote
  #7  
Old 09-14-2002, 11:57 AM
Acronym BOY Acronym BOY is offline
Web Hosting Master
 
Join Date: Mar 2002
Location: Westbury, LI NY
Posts: 1,705

Reply With Quote
  #8  
Old 09-14-2002, 02:22 PM
ghost ghost is offline
Junior Guru
 
Join Date: Aug 2002
Location: Istanbul / Turkey
Posts: 214
You can us Java for that;

Insert this in Head tags;

<script>
var winlength = screen.width;

function CheckSize();
{
if ( winlength =< 800 ) { window.location="http://www.thedigitaldream.co.uk/lowres/"; }
else { window.location="http://www.thedigitaldream.co.uk/hires/"; }
}
</script>

and insert it to Body tag like this;

<body bgcolor=#000000 onload="CheckSize();">

I think that can solve the problem.

__________________
-----------------------------------------------
Ghost of the Forum
-----------------------------------------------

Reply With Quote
  #9  
Old 09-14-2002, 02:24 PM
ghost ghost is offline
Junior Guru
 
Join Date: Aug 2002
Location: Istanbul / Turkey
Posts: 214
Quote:
Originally posted by ghost
You can us Java for that;
Sorry I mean "use"

Reply With Quote
  #10  
Old 09-15-2002, 01:51 PM
akashik akashik is offline
ex-Aussie
 
Join Date: Aug 2000
Location: Tacoma, Washington
Posts: 9,576
and mean javascript

Greg Moore

__________________
Former Webhost... now, just a guy.

Reply With Quote
  #11  
Old 09-15-2002, 09:31 PM
mattschinkel mattschinkel is offline
Web Hosting Guru
 
Join Date: Aug 2002
Location: Toronto, Canada
Posts: 286
<script language="JavaScript">
var mattwidth = window.screen.width;
var mattheight = window.screen.height
document.write(mattwidth)
document.write("x")
document.write(mattheight)
</script>

__________________
www.prolinker.com - free automatic linking to your website

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
The DIY Website Revolution Will be Televised Web Hosting News 2013-05-17 12:34:27
DNS Firm Neustar Releases Site Monitoring, Load Testing Platform Web Hosting News 2012-08-23 15:31:54
Judge Tells Megaupload, Carpathia, DOJ to Resolve Server Maintenance Duties Web Hosting News 2012-04-17 10:58:53
iPhone 5 Predictions Blog 2011-10-03 20:52:20
SOASTA Launches New Versions of Cloud Performance Testing Solutions Web Hosting News 2011-05-25 18:22:19


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?