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?
Screen Resolution
Moderator: General Moderators
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
nope thats javascript. im having some problems with a semi-similar problem but i think this code mite be somtin you can use
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
Code: Select all
<script language="e;JavaScript"e; type="e;text/JavaScript"e;>
var winW = 630, winH = 460;
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="e;Netscape"e;) {
winW = window.innerWidth;
winH = window.innerHeight;
}
if (navigator.appName.indexOf("e;Microsoft"e;)!=-1) {
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
}
document.write(
"e;Window width = "e;+winW+"e;<br>"e;
+"e;Window height = "e;+winH
)
</script>