Paul_Blackpool Posted July 31, 2012 Share Posted July 31, 2012 I have just completed the headers and footers section of the book. I created the index page as instructed and all works well, except I have an image on the header page that shows when I publish the header page but when I publish the index page I just get an empty box with a little red cross in the top left hand corner. Would be obliged if someone could take a look and let me know what I did wrong. I have included the Header, Footer and Index pages. Thanks Paul Header Page <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php echo $page_title; ?></title> </head> <body> <div id="header"><img src="images/header-2.jpg" width="775" height="108" alt="Header Image" /></div> <div id="navigation"> <ul> <li><a href="index.php">Home Page</a></li> <li><a href="calculator.php">Calculator</a></li> <li><a href="dateform.php">Date Form</a></li> <li><a href="#">Link Four</a></li> <li><a href="#">Link Five</a></li> </ul> </div> <div id="content"><!-- Page Specific Content goes Here. --> <!-- Script 3.2 - header.html --> Footer Page <div id="footer"> <p>"The Recruitment Services Bureau, Lytham, Lancs".<br> All Rights reserved, Job Vacancies Blackpool, Lancashire.</div></p> <p><strong>[<a href="#">Privacy Policy</a>] [<a href="#">Links</a>] [<a href="#">Site Map</a>] [<a href="#">Website Disclaimer</a>]</strong></span></div> </body> </html> Index Page <?php # Script 3.4 - index.php $page_title = 'Welcome to this site!'; include ('includes/header.html'); ?> <h1>Content Header</h1> <p>This is where the page specific content goes. This section, and the corresponding header, will change from one page to the next.</p> <?php include ('includes/footer.html'); ?> Link to comment Share on other sites More sharing options...
HartleySan Posted July 31, 2012 Share Posted July 31, 2012 Are you running the script from a server or virtual server? If not, it won't work. Link to comment Share on other sites More sharing options...
Paul_Blackpool Posted July 31, 2012 Author Share Posted July 31, 2012 Thanks for the reply. I had a play around with it and it was the code. I am using Dreamweaver and running on a local server xammp. In Dreamweaver the image has to be relative to the root and I had it relative to the document. The change in the code was: <div id="header"><img src="images/header-2.jpg" width="775" height="108" alt="Header Image" /></div> <div id="header"><img src="/scripts/includes/images/header-2.jpg" width="775" height="108" /></div> Its working fine now, However as I am going through the book I'm sure I will be back with something else i can't quite figure out Thanks Paul Link to comment Share on other sites More sharing options...
HartleySan Posted August 1, 2012 Share Posted August 1, 2012 Good show. Thanks for sharing the solution. Link to comment Share on other sites More sharing options...
Recommended Posts