Skip to content

Instantly share code, notes, and snippets.

<?php
include('includes/db_connect.php');
include 'includes/header.php';
?>
<!-- Page Content -->
<div class="container extra-top-margin"> <!--start container-->
<div class="row"><!--wrap both columns in a row-->
<div class="col-md-8"><!--blog entries column-->
<?php
//This prepared statement will 'prepare' the database for query to be run then when $statementt->execute is run. The items from the array will be bound and sent to the server.
<?php
include 'includes/header.php';
?>
<!-- Page Content -->
<div class="container extra-top-margin"> <!--start container-->
<div class="row"><!--wrap both columns in a row-->
<div class="col-md-8"><!--blog entries column-->
<?php
//This code creates a connection to the database
include('includes/db_connect.php');
<?php
//include database connection and class config
require_once('../includes/db_connect.php');
require_once('../includes/class_config.php');
//if not logged in redirect to login page
if(!$user->is_logged_in()){ header('Location: login.php'); }
?>
<!DOCTYPE html>
<head>
<?php
//include database connection and class config
require_once('../includes/db_connect.php');
require_once('../includes/class_config.php');
//if not logged in redirect to login page
if(!$user->is_logged_in()){ header('Location: login.php'); }
//show message from add / edit page
if(isset($_GET['deluser'])){
<?php
//include database connection and class config
require_once('../includes/db_connect.php');
require_once('../includes/class_config.php');
//if not logged in redirect to login page
if(!$user->is_logged_in()){ header('Location: login.php'); }
?>
<!DOCTYPE html>
<head>
<?php
//include database connection and class config
require_once('../includes/db_connect.php');
require_once('../includes/class_config.php');
//if not logged in redirect to login page
if(!$user->is_logged_in()){ header('Location: login.php'); }
?>
<!doctype html>
<head>
<h1>Admin area for blog</h1>
<ul>
<li><a href='index.php'>Blog</a></li>
<li><a href='users.php'>Users</a></li>
<li><a href="../" target="_blank">View Website</a></li>
<li><a href='logout.php'>Logout</a></li>
</ul>
<hr />
<?php
//include database connection and class config
require_once('../includes/db_connect.php');
require_once('../includes/class_config.php');
//if not logged in redirect to login page
if(!$user->is_logged_in()){ header('Location: login.php'); }
//show message from add / edit page
if(isset($_GET['delpost'])){
<?php
//include config
require_once('../includes/db_connect.php');
//log user out
$user->logout();
header('Location: index.php');
?>
<?php
if (!defined('PASSWORD_DEFAULT')) {
define('PASSWORD_BCRYPT', 1);
define('PASSWORD_DEFAULT', PASSWORD_BCRYPT);
}
Class Password {
public function __construct() {}