Tell me more ×  store value of input type="hidden" into a php
variable.  The value is set by javascript into a hidden
variable[input].  Now i need to save its value into a
$myphpvariable.  I cant set the value into session with
javascript and cookies is not an option.  share|improve this
question So ask the user to post the form and look at $_POST – 
zerkms Mar 3 '12 at 9:38 add comment  5 Answers  up vote 0 down
vote accepted  After the page is submitted, hidden input
elements will show up in the $_POST superglobal, just like any
other form element. If the hidden form field were called
coolsecret then the value would be in $_POST['coolsecret'] (or
$_GET['coolsecret'] if you used method=get).  Before the page is
submitted, there's no way to get a value from javascript into
PHP, because your PHP code is all executed on the server, and
the javascript isn't executed until the user has loaded the page
on their computer. You should think about what you're trying to
accomplish, and whether there's any way to comput