Pass screen size to a php

Javascript coding ..

Moderators: egami, macek, gesf

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

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
The greatest enemy of knowledge is
not ignorance; it is the illusion of knowledge.
-Stephen Hawking

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

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!
Sincerely,
Gonçalo "gesf" Fontoura

gesf.org | sessionstart.com | urlms.com

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

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
Best Regards,
Alexej Kubarev
-------------------------------
Zend Certified Engineer
Image Image

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest