Page 1 of 1

Screen Resolution

Posted: Fri Mar 18, 2005 11:42 pm
by s.dot
I have a banner that's messing up my table widths in 800x600 resolution. Since I use 1024 x 768, I didn't notice this until recently.

I've googled the problem, and all I can find are javascripts that write PHP lines of code, which confused the hell out of me because I'm not familiar with javascript.

What I would like to do is use a full banner if screen resolution >= 1024 x 768, and use a half banner if the screen resolution < 1024 x 768

Is there a way to do this using only PHP?

Posted: Fri Mar 18, 2005 11:44 pm
by feyd
no.

Posted: Sat Mar 19, 2005 12:17 am
by shiznatix
nope thats javascript. im having some problems with a semi-similar problem but i think this code mite be somtin you can use

Code: Select all

<script language=&quote;JavaScript&quote; type=&quote;text/JavaScript&quote;>
var winW = 630, winH = 460;

if (parseInt(navigator.appVersion)>3) {
 if (navigator.appName==&quote;Netscape&quote;) {
  winW = window.innerWidth;
  winH = window.innerHeight;
 }
 if (navigator.appName.indexOf(&quote;Microsoft&quote;)!=-1) {
  winW = document.body.offsetWidth;
  winH = document.body.offsetHeight;
 }
}

document.write(
 &quote;Window width = &quote;+winW+&quote;<br>&quote;
+&quote;Window height = &quote;+winH
)
</script>
also, iv been having trouble getting this to work in IE. I didnt write it i got it off some website somewere but it outputs the users screen resolution so you can then base your banner size off of the results...probebly some more javascript

Posted: Sat Mar 19, 2005 12:21 am
by feyd
there's a screen object for the data..