July 3, 201214 yr Hi, Just wondering if anyone can help me out. I am working on my ow personal website, and would like to build a one page scrolling website using php includes (To make easier to manage each page) I have built the structure, and included the head.php file that links to the css etc. I have also included a footer.php file and this works correctly. As this is going to be a one page scrolling site, I thought I would be able to have a section for each page and simply include that page via the php include method, however no content from these pages will display. Here is the code for my index.php page Thanks. <!DOCTYPE html> <html lang="en"> <html> <!-- Website Head --> <?php include 'includes/head.php'; ?> <body> <div id="main_container"> <!-- Website Pages --> <section id="home"> <?php include 'pages/home.php'; ?> </section> <section id="portfolio"> <?php include 'pages/portfolio.php'; ?> </section> <section id="services"> <?php include 'pages/services.php'; ?> </section> <section id="contact"> <?php include 'pages/contact.php'; ?> </section> <!-- Website Footer --> <?php include 'includes/footer.php'; ?> </div> </body> </html> Edited July 3, 201214 yr by Chris H
July 3, 201214 yr Author Are the paths to the includes correct relative to the index file? I believe so. the index file is in the root directory and the pages that are not displaying are in a file called pages. So the link is "include 'pages/about.php';" Thanks for the quick response.
July 3, 201214 yr D'oh, spotted it. Nope, that's not it. Put this at the top of your file to see what you did wrong: <?php error_reporting(E_ALL); ?> Edited July 3, 201214 yr by Renaissance-Design
July 3, 201214 yr Author D'oh, spotted it. Put this at the top of your file to see what you did wrong: <?php error_reporting(E_ALL); ?> I take it that goes at the top of the index file, Nothing happens, I have tried it on other pages as well.
July 3, 201214 yr Author Do you have it live somewhere? I'm testing it on wamp server on my local PC I can put it on-line if you like?
July 3, 201214 yr Author That'd be handy. Also, are the header and footer displaying? the footer is working fine, Although there is only some text in there atm, and same with the header. here is the link. http://candrwebsites.com/chris/ Cheers
July 3, 201214 yr Author Not to worry, it is all sorted now, For some reason Dreamweaver was not saving the index.php file in the correct location, so the local server was still picking up an old version. Sorry to bother you, and thank you fr your help.
Create an account or sign in to comment