0

Duplicate:
Access a JavaScript variable from PHP

hi

i want get value from java script, then i will use the value in php, both are in single php file.

send how to connect with these two in single file....

thanks

Community
  • 1
  • 1
zahir hussain
  • 3,711
  • 10
  • 29
  • 36

1 Answers1

0

you can use post or get request to your current page (or to another page) using <form> tag or ajax. Then in the php you will use $_REQUEST (or $_POST or $_GET) which act as associative array with the key being the name of your variable. So if you submitted mypage.php?foo=bar

in php $_REQUEST['foo'] will be bar.

Ryu
  • 8,641
  • 10
  • 65
  • 98