Topic: PHP include() not diplaying contents
EDIT
Okay, this PHP crap has left my brain in a pretzel. I figured out a way to get the same effect with iframes, so I'm just not going to use the PHP include function. When, if ever, I really have to use it, I'll figure it out then.
Anyway, I really appreciate the help from everyone. This is the best web coding forum ever! ![]()
Hello,
I recently learned about PHP includes() and decided to try and use it on a header and footer for a website I'm building. I saved the header contents as a PHP file, and I put the include code into my index.htm page with the correct path name. But for some reason, when I view the index.htm document it doesn't display the contents of header.php. It doesn't give me an error either. I tried to upload it to my hosting to see if it would work then, but again just a blank page.This wouldn't be the first time PHP has stumped me, and I really appreciate the help.
My header.php code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="CSS/navbarAWARE.css"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <div align="center"><img id="logo" src="Images/logoAWAREwhite440.png" width="440" height="396"><br> </div> <div id="navcontainer"> <ul id="list-nav"> <li><a href="index.htm">Home</a></li> <li><a href="whoweare.htm">Who We Are</a></li> <li><a href="hawkpierce.htm">Hawk Mystery</a></li> <li><a href="eduprograms.htm">Training & Educational Programs</a></li> <li><a href="rehabworld.htm">A Rehabilitator's World</a></li> <li><a href="needslist.htm">Needs List</a></li> </ul> </div> </body> </html>The PHP include() code in the index.htm document:
<body> <div id="container"> <div class="menu"><?php include("header.php"); ?></div> </div> </body>Thanks again,
-Raven
Last edited by rsrwebs (2009-10-29 15:01:04)
