Pass screen size to a php

Javascript coding ..

Moderators: macek, egami, gesf

User avatar
popeye
New php-forum User
New php-forum User
Posts: 120
Joined: Sat Jan 03, 2004 7:06 pm
Location: New York, NY

Pass screen size to a php

Postby popeye » Wed Jul 26, 2006 2:14 pm

I need to pass the available screen width and height to a php script. I know I can get the W & H using a Java script but how would I send it to the PHP? Where in PHP script would I code the Java? Or is it the other way around?
Thanks

User avatar
gesf
Moderator
Moderator
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Postby gesf » Sat Jul 29, 2006 8:33 pm

Hey popeye,

You can "send it" through URL to some file (GET method). E.g: file.php?w=800&h=600
You can also "sent it" via form (POST method) in hidden fields.
Ther's no other way!

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Wed Aug 02, 2006 5:18 am

well well...
gesf was almost right about no other way..
there is no other SMART way to do it. hehe.. Im thinking now about 100 diferent stupid, extremly complex and absolutely freaking useless way of doing it.

However hidden fields are not the only thing that you can post with :) don't forget ajax requests. However this in most cases will not be the smartest way :)

So listen to what gesf said, and do it that way :D


Return to “JavaScript”

Who is online

Users browsing this forum: No registered users and 1 guest

cron