title: access php variable into external javascript file
body: <p>I get var value into php code. I want to access it into included test.js file. </p>
  
  <pre><code>&lt;?php
   session_start();
  $var=$_SESSION['my_id'];  // I want to access $var into test.js included below
  ?&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript" src="test.js"&gt;&lt;/script&gt;
  &lt;!-- AddThis Smart Layers END --&gt;
  &lt;/head&gt;
  &lt;input type="submit" onclick="func();"&gt;  Button &lt;/input&gt; //This function call test.js
  &lt;body&gt;
  </code></pre>
  
  <p>How can I access $var into test.js? </p>