PHP simple Includes not working

I have this in my html page where the footer would go:

<?php include './includes/footer.php'; ?>

And I have an includes file named footer.php inside an includes folder on the site's root directory with this in it:

<footer><p>&#169; Foothills Rehabilitation LLC Idaho Falls, ID 83404</p></footer>

Why is it not working?  It's like it doesn't see the includes file.  

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
Try ...

<?php include '/includes/footer.php'; ?>

And if your page is already in the root...

<?php include 'includes/footer.php'; ?>

'./' means go up one directory level.  '/' by itself is root relative, and no slash means relative to the current directory.
<?php include $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?>

Open in new window

notice that the "dot" is outside the single quote.

>> './' means go up one directory level.
You mean "../".  "./" means "the current directory".  However if he is in /someFolder/file.php, then "./includes/footer" is looking for footer within "someFolder" instead of the site's DOCUMENT_ROOT.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
andejul3Author Commented:
Thanks so much.  I had just forgotten to change the .htm to .php on the file.  But I learned a few things from your comments.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Ray PaseurCommented:
If you're new to PHP and want some good learning resources, this article can help point you in the right direction.  If you're an experienced programmer looking for PHP-only guidance, just skip over the elementary parts that you already know.
RobOwner (Aidellio)Commented:
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
Ray PaseurCommented:
Dave and Hielo both gave complete and accurate answers, within seconds of each other and within 10 minutes of the time of posting.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.