Location: PHPKode > projects > JaxBlog > JaxBlog/app/admin/admin_login/admin_login.php
<?php

require_once('../../../config.php');

// If user submits credentials, validate them here.
$message = '';

$request = isset($_GET['request']) ? $_GET['request'] : '';

if ($request == 'login') {
	$username = stripslashes($_POST['username']);
	$password = stripslashes($_POST['password']);
	if ($username == ADMINISTRATIVE_USERNAME && $password == ADMINISTRATIVE_PASSWORD) {
		session_start();
		$_SESSION['admin'] = 'admin';
		header('location: ../admin_home/admin_home.php');
		exit;
	} else {
		$message = 'Invalid credentials, please try again.';
		sleep(5);
	}
}

require_once(FOLDER_RELATIVE_COMMON . 'builder-admin.php');

$header   = '<script type="text/javascript" src="admin_login.js"></script>' . "\n";
$onload   = "document.getElementById('message').innerHTML = '" . $message . "'; document.getElementById('username').focus();";
$title    = 'Admin Login';
$content  = 'admin_login.html';

$page = buildAdminPage($header, $onload, $title, $content);

echo $page;

?>
Return current item: JaxBlog