--- tarniadi <[EMAIL PROTECTED]> wrote: > I want to know how can I obtain in a php variable the screen size of > the client monitor. I don't know how to pass the value of a JavaScript > variable to a PHP variable. > > Adrian
PHP doesn't have a variable with the screen size because it is not part of the HTTP request. PHP does reveal the values available in the HTTP request. If your site has multiple pages, you could take the value from Javascript and find a way to pass it to PHP. One way would be to attempt to load an image from a PHP script and pass some values as GET variables: <img src="pic.php?var=value&var2=value2"> The pic.php script would accept these GET variables and store them in a SESSION or other long-term storage location so the values would be available in you next PHP page. The pic.php script should also send some image data, even a 1x1 pixel invisible GIF image so you don't get broken image links or error messages in some browsers. There are also techniques which could involve a hidden iframe. Also mentioned by another poster is the relatively new AJAX system which involves sending an HTTP request from Javascript and processing any return values. It is tricky to get working smoothly and can be slow at times. James _____ James D. Keeline http://www.Keeline.com http://www.Keeline.com/articles http://Stratemeyer.org http://www.Keeline.com/TSCollection http://www.ITeachPHP.com -- Free Computer Classes: Linux, PHP, etc. Fall Semester Begins Sep 7 -- New Classes Start Every Few Weeks. ------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/HKFolB/TM --------------------------------------------------------------------~-> Community email addresses: Post message: [email protected] Subscribe: [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] List owner: [EMAIL PROTECTED] Shortcut URL to this page: http://groups.yahoo.com/group/php-list Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php-list/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
