Forum Moderators: coopster
the code went something like this
<html>
<head></head>
<body>
<?php require('header.php'); /?>
my content
<?php require('footer.php'); /?>
</bdoy>
</html>
When I put it up on my server, there was a parse error with the header file, but when I changed it to include instead of require, it worked fine. I thought the diff was how they handled errors?
"include" says, "Go get that file and put it into the lineup HERE." It doesn't really care whether the file is error-free, or not, and will render the rest of the page if it encounters a "non-fatal" error in the included file.
"require" says, "Go get that file and put it into the lineup HERE, unless there is something wrong with it." An error in a required file will result in a fatal error. That stops everything right there. The file is "required" to be error free, because the rest of the page depends on it.
We have a thread on troubleshooting [webmasterworld.com] code in our library. You might want to take a peek :)