Search code examples
phphtmlincludeeasyphp

PHP include doesn't show content


I'm trying to include a PHP file with plain HTML inside into another HTML file but the include is not displaying anything.

My dir tree is this:

  • ROOT
    • images
    • includes
      • header.php
    • variables
    • index.html
    • style.css

I put this include in the index.html

<?php include('includes/header.php'); ?>

And this is how the header PHP looks like:

<div id="header">
<div class="center">
    <a href="#"><img id="logo" src='images/logo.png' alt="Home" />
    </a>
    <ul>
        <li><a href="#">INICIO</a> |</li>
        <li><a href="#">SOCIAL</a> |</li>
        <li><a href="#">MAPA DEL SITIO</a> |</li>
        <li><a href="#">RSS</a> |</li>
        <li><a href="#">LOGIN</a> |</li>
        <li><a href="#">REGISTRO</a>
        </li>
    </ul>
</div>

Note: I'm using EasyPHP under Windows7.


Solution

  • Try renaming your file to index.php. ;)

    By the way, use quotes around the dir/file. include('bla.php');