PHP Login script using Session variables
===

I created a login form in PHP and after checking the correct username and password from the database, I created a session variable to store the username.

      session_start();
      $_SESSION['user']=$user;
      header( "Location: successPage.php" );

Thereafter I redirected the user, to the new page. This works perfectly in the `successPage.php` by displaying the username via the `echo` statement. However when I use the following code in other pages, it only displays the PHP code and not the result

	session_start();
	if(isset($_SESSION['user'])){
	echo "<p>You are logged in as ".$_SESSION['user'];
	echo "<a href='logout.php'>Click here</a>to logout";}
	
