I am getting a parse error while running a file on my server on my home machine:

Parse error: syntax error, unexpected end of file

I have been researching this for a few hours now but have had no results to overcome this error.

In the editor it is indicating the last line, </html>, but I am sure that last line is correct and the error must lie somewhere in the code above that.

Any advice or pointers in the right direction would be much appreciated.


    <!-- The tab on top -->  
    <div class="tab">
        <ul class="login">
            <li class="left">&nbsp;</li>
            <li>Hello Guest!</li>
            <li class="sep">|</li>
            <li id="toggle"></li>
                <a id="open" class="open" href="#">Log In | Register</a>
                <a id="close" style="display: none;" class="close" href="#">Close Panel</a>                       
            <li class="right">&nbsp;</li>

    </div> <!-- / top --> 
</div> <!--panel -->

    <div id="container">
        <div id="content" style="padding-top:100px;">
        </div><!-- /content -->       
    </div><!-- /container -->


Recommended Answers

All 3 Replies

Probably unclosed tag or speech marks.


from the error message it seems the page includes PHP, if affirmative then check that the variables are correctly closed, for example here is missing the semicolon:


    $a = 'hello'

<!DOCTYPE html>

And will generate the same parse error, pointing the end of the file even if the variable is on the top of the file.

Definitely an issue with proper closing of tags...

Once I got this error working in php...
In my case the issue was... <? ?>
I was wondering.. ya the tags are closed... then realized...
The shorthand tags were disabled in my php.ini file....

Once I changed it to <?php ?>

It worked...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.