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!

Javascript + PHP

Status
Not open for further replies.

buzzt

Programmer
Oct 17, 2002
171
CA
I need to capture the values for screen height and screen width and assign them PHP variable names ($width, $height) without reloading or submitting the page. Can I do this?
 
Nope. The screen height and width are only available to JavaScript (which runs on the browser), and the only way to get the data to PHP (which runs on the server) is to submit data to the server.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
not that i am aware of?

could you create a page with an iframe taking up all but a pixel border, use the framing page to pick up h and w via javascript and then call the real page inside the iframe using javascript with necessary parameters in the url?

this way there won't be a reload but it will delay the primary load a bit.
 
My earlier post said, you might be able to send the browser and intermediate page with an HTML form and some JavaScript which fills in the blanks and automatically submits the form. The data gets back to PHP, which records it, perhaps in a session variable, then sends the browser to the "real" page.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top