title: passing variables from javascript to php
body: <p>i am passing variable from javascript php with the following code by using cookie.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function gTest() {
                 var country = 'hello testing';
      document.cookie = 'name=document.write(country);' ; 
           document.write(country);
  }
  gTest();
  &lt;/script&gt;
  
  
  &lt;?php  
  echo "&lt;br&gt;";
       var_dump($_COOKIE['name']);  
  ?&gt; 
  </code></pre>
  
  <p>it works fine if we change to </p>
  
  <pre><code>    document.cookie = 'name=hello' ; 
  </code></pre>
  
  <p>i want to pass variable value to php in same page...i don't want to send to another page.</p>
  
  <p>thanks</p>