Lila Avenue

Website Projects

Build a CMS Step 3

← Return to Build a CMS

Password Protected Administrator Functions

These functions will allow us to edit our website securely without needing to upload files to a web hosting account. In the following demo, you will find a 'login' button at the bottom of each page.

2 college catsCLICK HERE FOR DEMODownload Files

We will need the following additions to our website folder:

  • Two text files in the data folder - 'username.txt' and 'password.txt'
  • Two php files in the pages folder - 'login.php' and 'logout.php'
  • An 'admin' folder to hold an administrator file and a file for updating page content
  • A specialized version of index.php - 'admin.php' that produces pages from the 'admin' folder
  • Links in the footer.php file to the login page and the logout page

Files and Folders for CMS-03

 Files and folders for  CMS-03

File and folders in the data folder

 Files and folders for  CMS-03

File and folders in the admin folder

 Files and folders for  CMS-03

Code files:


Pages

admin

Inc