Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

screenwidth +screenheight

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello, PHP'ers

Does anyone know how to determine the screenwidth and the screenheight (resolution) in PHP?
I know a javascript which can determine the resolution, but i'd like it in PHP. Can anyone help me, please. I really need this for my site!

The javascript is:
<script>
// for NN4/IE4
if (self.screen) {
width = screen.width
height = screen.height
}

// for NN3 w/Java
else if (self.java) {
var javakit = java.awt.Toolkit.getDefaultToolkit();
var scrsize = javakit.getScreenSize();
width = scrsize.width;
height = scrsize.height;
}
else {

// N2, E3, N3 w/o Java (Opera and WebTV)
width = height = '?'
}

if (screen.width > 1024) {
}

if (screen.width < 1024) {
}
if (screen.width == 1024) {
}

</script>


Thnx in advance,
Boogey Man
 
Since PHP is completly server-sided, there is no way to get any information about the clients beside tcp/ip related such as OS, IP address and so on.

You'll have to use JS.

cu, Sascha cu, Sascha
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top