title: How to store the value of a javascript variable into php variable?
body: <p>I need to pass a value from javascript to php. How can i achieve this since one runs on client side and other on server? or any other alternatives for this to happen? I am a newbie in programming, so correct and suggest me if i am wrong.</p>
  
  <pre><code>&lt;html&gt; 
      &lt;head&gt;
         &lt;SCRIPT language="JavaScript"&gt; 
  
            var q1=Math.floor(Math.random()*11) 
            &lt;?php 
               $ff =  q1; 
            ?&gt;
         &lt;/SCRIPT&gt; 
  
      &lt;/head&gt; 
  
      &lt;body&gt; 
         &lt;?php 
            echo $ff ; 
         ?&gt; 
      &lt;/body&gt; 
  &lt;/html&gt; 
  </code></pre>