Computer Operations/Database/General Rules
From MFIWiki
29 March 2024
MFI Computer Operations
MFI Database General Programming Rules
All DB pages need to start with the following code:
//Initial setup
- session_start();
- //Address error handling
- ini_set ('display_errors', 1);
- error_reporting (E_ALL & ~E_NOTICE);
- // Include required files
- include_once("include/db.inc.php");
- include_once("include/error_handler.php");
- // Start up our wonderful db connection
- $conn = db_connect();
//Check user is logged into the DB system
- if (! (isset($_SESSION['id']))) {
- header("Location: dblogin.php");
- exit;
- }
The following code is used to start the HTML section of the page:
// Create HTML
- //Set header variables
- $pic = picture("member",$view);
- $nav = navigationbuttons2("member",$view);
- if (isccmember()) {
- $title = "Reset Password for".rankandname($view);
- }else{
- $title = "Changing My Password";
- }
- //Create Header and Footer
- $header = htmlheader($title,$nav,$updated,$pic);
- $footer = htmlfooter($nav);