Forum Moderators: coopster
<? php include("/includes/header.html"); ?>Content... //The page is named articles.php
</div>
</div>
</div><? php include("/includes/footer.html"); ?>
I figured that putting in the </div> tags might be important for some reason, I don't really know. Is there ANYTHING wrong with the code?
When I upload the .php file to my File Manager it shows that the file is broken or something. What could that mean?
error_reporting(E_ALL ^ E_NOTICE);
ini_set('display_errors', 'stdout');
Also, make sure the path is correct. The included file's path is relative to your file system, it doesn't go through the web server to fetch its contents. So if your filepath is really '/includes/header.html', then PHP will look for it in the includes folder/directory at the root of your filesystem, i'm guessing more likely you want to use a relative path like 'includes/header.html' (without the starting / ) or something like '/path/to/document/root/includes/header.html'.
<?php include 'includes/header.html'; ?>
or
<?php include '../includes/header.html'; ?>
The server encountered an unexpected condition which prevented it from fulfilling the request.
The script had an error or it did not produce any output. If there was an error, you should be able to see it in the error log.
And also, my code says...
index.php
<html>
<body>
<p>Blah</p><?php include '../includes/full.html'; ?>
<p>This is my home page that uses a common menu to save me time when I add
new pages to my website!</p>
</body>
</html>
full.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Untitled document</title>
</head>
<body>
<p><a href="http://www.example.com/index.php">Home</a> - <a href="http://www.example.com/about.php">About Us</a> - <a href="http://www.example.com/links.php">Links</a> - <a href="http://www.example.com/contact.php">Contact Us</a></p>
</body>
</html>