Passing a variable from one page to another using PHP
<p>Does anyone know what's wrong with the code below that prevents me from printing in <code>File2.php</code> the variable <code>$myusername</code> from <code>File1.php</code>.</p>

<p>I simply wanna print the variable <code>$myusername</code>, or if you know any other way of how to pass that variable that would be very helpful for me.</p>

<p>Here is my example:</p>

<p><strong>File1.php</strong></p>

<pre><code>&lt;?php 
$myusername=$_POST['myusername']; 

function getusername() 
{ 
   return $myusername;    
} 
?&gt;
</code></pre>

<p><strong>File2.php</strong></p>

<pre><code>&lt;?php 
require_once('File1.php'); 
getusername(); 
?&gt;
</code></pre>
