There are a lot of pages in this website, so to combat the problems there are with editing multiple pages, I’ve used some PHP code to hasten the editing process. Basically, I’ve taken some repetitive features of the website: title, navigation and footer, and given each element its own html page. This is saved as a .php file, which is then linked to each page using the code: <?php include('../FOLDER/FILENAME.php'); ?>

To test if this worked, I first used the code on my own website, replacing the header, navigation and footer html code with php includes and putting the above code in place of the html.

testing php localhost pre template carving for bean

As this worked, I did the same for the default project pages I had created in preparation for creating all of the actual project pages. Without a server, you cannot see php in action.I put my locally hosted WAMP server online and tested to see if it was working.

Before being tested:

defaultpage - php includes before

After:

defaultpage - php includes after

Now that I know this works, if I need to amend anything in the html of these elements, I’ll only have to change one file to change that element on every page.

Advertisements