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!

Include javascript variable in php link

Status
Not open for further replies.

Luongo1

Programmer
Oct 13, 2006
52
CA
Wasn't sure whether to post this in the javascript or php forum but thought I'd try it here. I need to pass the current scroll positions of a page (window.offsetX and window.Offsety) in a URL that would also contain php variables.

For example, something like this: page.php?id=$productid&scrollX=window.offsetX&Y=window.offsetY. Obviously this example would not work but it's the effect I'd like to achieve. How could I incorporate these javascript variables into the URL?

Thanks...
 
Cookies can be set with Javascript in the browser, which can be read by PHP in $_COOKIES on the next request, provided that the browser supports cookies.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top