simple pass variable to php from javascript
<p>Can someone write me a simple script that will pass the variable to the hidden date field and than echo it through php? I know that is duplicated but I didn't understand from the duplicates.</p>

<pre><code>      &lt;script&gt; var a=20 //how to send a to hidden field &lt;/script&gt;

       &lt;form  method="POST"&gt; 

    &lt;input type="hidden" name="dated" id="date" onload="this.value = getDate();"/&gt;
    &lt;input type="hidden" name="dd3" value="0" id="dd3"  /&gt; 
    &lt;input type="submit" /&gt;

 &lt;/form&gt; 

  &lt;?php 
 if(isset($_POST)) 
  { 
    print_r($_POST); 
 } 



  echo "\n welcome \n";
  if(!empty($_POST)){echo $_POST["dated"];}
 echo $_POST["dated"]." teksssss";
</code></pre>
