title: How to access a variable across two files
body: <p>I have three files - <code>global.php,</code> <code>test.php</code>, <code>test1.php</code></p>
  
  <p>Global.php</p>
  
  <pre><code>$filename;
  $filename = "test";
  </code></pre>
  
  <p>test.php</p>
  
  <pre><code>$filename = "myfile.jpg";
  echo $filename;
  </code></pre>
  
  <p>test1.php</p>
  
  <p><code>echo $filename;</code></p>
  
  <p>I can read this variable from both test and test1 files by 
  <code>include 'global.php';</code></p>
  
  <p>Now i want to set the value of <code>$filename</code> in <code>test.php</code> and the same value i want to read in <code>test1.php.</code></p>
  
  <p>I tried with session variables as well but due to two different files i am not able to capture the variable.</p>
  
  <p>How to achieve this........</p>
  
  <p>Thanks for help in advance.....</p>