About - warwickfoster/qurantools GitHub Wiki

File: app/404.php

Purpose

This is a PHP code snippet for a customized 404 error page for a Qur'an Tools website.

  • To display an error message when a user accesses a non-existent page.
  • To provide a redirect to the home page after a specified time.

Features

  • Session handling The code checks if the user is logged in and includes the necessary files if they are.
  • Header and navigation A standard header and menu are included.
  • Error message A message indicating that the page was not found is displayed.
  • Timer A timer counts down from 10 seconds and automatically redirects the user to the home page.
  • Links The user can also manually click a link to the home page or log in if they are not logged in.
  • Footer A footer with copyright information is included.

Code Breakdown

  • Header The standard header and title are included.
  • Body
    • The menu is included based on whether the user is logged in.
    • An image of the Qur'an Tools logo is displayed.
    • A title indicating an error is set.
    • A paragraph with an error message is shown.
    • A timer with a redirect is implemented.
    • Links to the home page and login page are provided.
  • Footer The footer is included.

Usage

This code can be placed in a PHP file and served as a 404 error page. When a user accesses a non-existent page, this page will be displayed.

Note

  • The library/config.php and library/functions.php files are assumed to be included in the project directory.
  • The home.php page is assumed to be the home page of the Qur'an Tools website.
  • The auth/login.php page is assumed to be the login page.