Lila Avenue

Website Projects

Build a CMS Step 2b

← Return to Build a CMS

Make our pages dynamic

A 'static' website uses a separate file for each page. A 'dynamic' website uses the index.php file to build each page according to some instructions.

First, we need to put the 'main' sections for each page into a new folder called 'pages'.

Contents of the 'pages' folder:

contents of the pages file for CMS-02b

Next, we need to add a little message to each menu item to tell index.php what page we want to see. This is called a 'query'.

menu for dynamic website

Last, we need to have index.php check for this query using the PHP 'get' command.

Index file for a dyamic website

Updated folders and files:Files and folders for CMS-02b

2 college cats CLICK HERE FOR DEMO

Inc

Pages