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.  

Thanks.
andejul3Asked:
Who is Participating?
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.
3
hieloCommented:
Try:
<?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.
2

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.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy 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.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_11769-And-by-the-way-I-am-new-to-PHP.html
0
RobOwner (Aidellio)Commented:
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
0
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.
0
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
HTML

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.