title: How to display sessions information using php
body: <p>I am trying to display session information like username, as user login through login page, the session has to capture user entered username and should display in page. Below i have tried php script, but its not echoing the username, Kindly check in the script for errors, thanks in advance.  </p>
  
  <pre><code>&lt;?php
  
      session_start();
  
      $_SESSION['test']= $_POST['myusername'];
      $name= $_SESSION['test'];
  echo $name;
  ?&gt;   
  
   &lt;form action="login.php" method="post"&gt;
  &lt;p&gt;Username&lt;/p&gt; 
  &lt;input name="myusername" type="text" id="myusername" required&gt;
  &lt;p&gt;Password&lt;/p&gt;
  &lt;input name="mypassword" type="password" id="mypassword"required&gt;&lt;/br&gt;
  &lt;button&gt;&lt;img src="http://icons.iconarchive.com/icons/webiconset/application/32/Register-icon.png"  /&gt;&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>login.php  </p>
  
  <p>Output i am getting is , simply its going to next page without displaying user name.</p>