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 variable to php

Status
Not open for further replies.

david6633

Programmer
Jul 28, 2003
39
GB
I am sure I have seen this somewhere but I cannot seem to find it again!

How do I write a js variable into a php variable?

I have tried
Code:
$data = "document.forms['test'].elements['input0']";
but it does not work

David
Remember: You only know what you know
and - you don't know what you don't know!
 
you cannot. php runs on the server, and javascript runs on the client. the two cannot directly communicate. you'll need to pass values to the server via post or get methods, and then parse it from those server variables.



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top