title: how to pass javascript variable to php function?
body: <p>I need to pass javascript variable to php. This the code.this function call from dropdown.  </p>
  
  <pre><code> &lt;script&gt;
     function functionname2(){
         var ab = $("#ma").val(); 
  
        var va= &lt;?php $ab1=ad;  echo TTable::model()-&gt;attr($ab1)?&gt;; 
        if(va==='true')
            {
                var r=confirm("Press a button");
                 if (r==true)
                  {
                      x="You pressed OK!";
                  }
                  else
                  {
                      x="You pressed Cancel!";
                  } 
            }
    }   
     &lt;/script&gt;
  </code></pre>
  
  <p>can any one know how to do this ? </p>