PHP Require is not working as I expected
<p>Please review the below code and advise what is wrong with it when using require.</p>

<p>First here is the code that works (not using require in it):</p>

<pre><code>&lt;?php
//require("_start.inc");
session_start();

if(!isset($_SESSION['user']))
{
    echo "&lt;h1 style='color:red'&gt;Please &lt;a href='../index.php'&gt;login&lt;/a&gt; first!&lt;/h1&gt;";
}
else
{
?&gt;

&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Main window&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;h1&gt;Admin panel&lt;/h1&gt;
&lt;?php
require("header.inc");
?&gt;
&lt;/body&gt;

&lt;/html&gt; 
&lt;?php
//require("_end.inc");
}
?&gt;
</code></pre>

<p>And here is the version that doesn't work, _start.inc and _end.inc are exactly what is written in the above code, but the below one give me an error:
Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\admin_start.inc on line 9</p>

<pre><code>&lt;?php
require("_start.inc");
/*session_start();

if(!isset($_SESSION['user']))
{
    echo "&lt;h1 style='color:red'&gt;Please &lt;a href='../index.php'&gt;login&lt;/a&gt; first!&lt;/h1&gt;";
}
else
{
*/
?&gt;

&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Main window&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;h1&gt;Admin panel&lt;/h1&gt;
&lt;?php
require("header.inc");
?&gt;
&lt;/body&gt;

&lt;/html&gt; 
&lt;?php
require("_end.inc");
//}
?&gt;
</code></pre>
