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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server side screen resolution detection ?

Status
Not open for further replies.

jamesa74

Programmer
Jan 10, 2001
20
IL
I want to print different html pages for different screen resolutions.

Is there a way my cgi can detect the user's screen resolutin? (I knw how to do it on the client side, I want to do it on the server side)

Thanks
 
I just did a quick search of CPAN and did not find anything that could be found relating to finding the users resolution.

I know that you can do this with C/C++ and some libraries, so you might want to investigate that further.

Question though, why would you want to do this on the server side? It just adds more strain on the server. Just use JavaScript to do so would be my suggestion.

Hope this helps.
-Vic vic cherubini
vikter@epicsoftware.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director
====
 
Of course it can be done :)
a little javascript, that is triggerd on the form "submit"
don't actually use a submit button, use a normal button:
<button onclick=&quot;doScreen_Submit()&quot;>Submit</button>
<input name=&quot;screenW&quot; type=hidden>
<input name=&quot;screenH&quot; type=hidden>

<script>
function doScreen_submit()
{
form.screenW.value = document.screenWidth
form.screenH.value = document.screenHieght

form.submit()
}
</script>

i'm pretty sure thats all you need, but you might want to check MSDN online for the proper syntax for the res vars

hope this helps,
Sib

Siberdude
siberdude@settlers.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top