We help IT Professionals succeed at work.

Error in CSS

mustish1
mustish1 asked
on
Can you please tell me what this error means?  Thanks.

Error in CSS
<?php
$title = "Home";
$content = '<img src="Images/coffee1.png" class="imgLeft" />
<h3>Title 1</h3>
<p>
    This Coffee web site is under construction. This Coffee web site is under construction.
    This Coffee web site is under construction. This Coffee web site is under construction.
    This Coffee web site is under construction. This Coffee web site is under construction.
    This Coffee web site is under construction. This Coffee web site is under construction.
    This Coffee web site is under construction. This Coffee web site is under construction.
    This Coffee web site is under construction. This Coffee web site is under construction.
    This Coffee web site is under construction. This Coffee web site is under construction.    
</p>

<img src="Images/coffee2.png" class="imgRight"/>
<h3>Title 2</h3>
<p>
    This Coffee web site is under construction. This Coffee web site is under construction.
    This Coffee web site is under construction. This Coffee web site is under construction.
    This Coffee web site is under construction. This Coffee web site is under construction.
    This Coffee web site is under construction. This Coffee web site is under construction.
    This Coffee web site is under construction. This Coffee web site is under construction.
    This Coffee web site is under construction. This Coffee web site is under construction.
    This Coffee web site is under construction. This Coffee web site is under construction.    
</p> 

<img src="Images/coffee3.png" class="imgLeft" />
<h3>Title 3</h3>
<p>
    This Coffee web site is under construction. This Coffee web site is under construction.
    This Coffee web site is under construction. This Coffee web site is under construction.
    This Coffee web site is under construction. This Coffee web site is under construction.
    This Coffee web site is under construction. This Coffee web site is under construction.
    This Coffee web site is under construction. This Coffee web site is under construction.
    This Coffee web site is under construction. This Coffee web site is under construction.
    This Coffee web site is under construction. This Coffee web site is under construction.
    This Coffee web site is under construction. This Coffee web site is under construction.
    This Coffee web site is under construction. This Coffee web site is under construction.    
</p>';

include 'Template.php';
?>

Open in new window

Comment
Watch Question

I guess NetBeans just does not expect an HTML text inside a variable. That makes it confused, so it throws that error.
Chinmay PatelChief Technology Ninja
Distinguished Expert 2019

Commented:
<<Removing ASP.Net / C#>> tags
I use Apache Netbeans.  I placed your code in a new file and do not get an error.

Author

Commented:
Its not showing the page correctly. Also I cant find this line any where in the code.

<<Removing ASP.Net / C#>> tags
screenshot2.JPG
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title><?php echo $title; ?></title>
        <link rel="stylesheet" type="text/css" href="Styles/Stylesheet.css" />
    </head>
    <body>
        <div id="wrapper">
            <div id="banner">             
            </div>
            
            <nav id="navigation">
                <ul id="nav">
                    <li><a href="index.php">Home</a></li>
                    <li><a href="#">Coffee</a></li>
                    <li><a href="#">Shop</a></li>
                    <li><a href="#">About</a></li>
                </ul>
            </nav>
            
            <div id="content_area">
                <?php echo $content; ?>
            </div>
            
            <div id="sidebar">
                
            </div>
            
            <footer>
                <p>All rights reserved</p>
            </footer>
        </div>
    </body>
</html>

Open in new window

Most Valuable Expert 2018
Distinguished Expert 2019
Commented:
The error that you're getting is more of a warning than an error. It's considered best practice to NOT add closing PHP tags at the end of a file. Doing so can sometime result in additional whitespace and that can cause problems. Just drop the closing ?> from the end of your file so it ends like this:

</p>';

include 'Template.php';

Open in new window

Notice there is no closing PHP tags - ?>

And for 'not showing the page correctly', what exactly do you mean. The page looks like it doesn't have any stylesheets applied, so either the path to your Styles/Stylesheet.css is wrong (it's a relative path, so it's expecting to find the Styles folder under the CoffeeWebsite folder) or there is nothing relevant in your Stylesheet.css file.

Commented:
I could not find any errors with that code. There is a chance that your editor's parser has issues with multi-line strings.

Author

Commented:
Here is the screen shot. I think the path is correct.
screenshot.JPG
Most Valuable Expert 2018
Distinguished Expert 2019

Commented:
Ok. Well nowhere in that screenshot is a Styles folder or a stylesheet.css file, so either it's missing completely or its outside of your project

Author

Commented:
Thank You.