So I am new to coding PHP and am working on creating a login system. I have followed this tutorial and have done everything that he has said, but when I open any of the files it just shows the code. http://www.youtube.com/watch?v=c_hNNAdyfQk
I really need help figuring this out and would love any feedback that I can get.
Here is the code that I used for index.php
<?php
require_once 'core/init.php';
if(Session:exists('home')) {
echo '<p>'. Session::flash('home') . '<p>';
}
$user = new User();
if($user->isLoggedIn()) {
?>
<p> Hello <a href="#"><?php echo escape(user->data()->username);</a>!</p>
<ul>
<li><a href="logout.php"> Log out</a></li>
</ul>
<?php
} else {
echo '<p> You need to <a href="login.php">log in</a> or <a href="register.php">register</a></p>';
}