Admin Blog Login

AdminBlog Login

Blog Login
$_SERVER["SCRIPT_NAME"]
/php/blog/admin/blog-login.php

print_r($_GET)
Array
(
)


print_r($_POST)
Array
(
)


print_r($_SESSION)
Array
(
)


print_r($_FILES)
Array
(
)


<?php

$error = '';
if (isset($_POST['login'])) {
    session_start();
    $username = trim($_POST['username']);
    $password = trim($_POST['pwd']);
    // location to redirect on success
    $redirect = 'blog-list.php';
    require_once('../../includes/authenticate_mysqli.php');
}


# Robert's Custom Variable (Do Not Use)
$tools = true;

# The header section of the layout.
include("../../includes/header.php");
?>

<main>
    <h2><?php echo $folder_name; ?><span><?php echo $file_name; ?></span></h2>
    <?php
    if ($error) {
        echo "<p class=\"error\">$error</p>";
    } elseif (isset($_GET['expired'])) {
    ?>
        <p class="error">Your session has expired. Please log in again.</p>
    <?php } ?>
    <form id="form1" method="post">
        <fieldset>
            <legend><?= $file_name ?></legend>
            <ol>
                <li>
                    <label for="username">Username:</label>
                    <input type="text" name="username" id="username">
                </li>
                <li>
                    <label for="pwd">Password:</label>
                    <input type="password" name="pwd" id="pwd">
                </li>
                <li>
                    <input name="login" type="submit" id="login" value="Log in">
                </li>
            </ol>

        </fieldset>
    </form>
</main>
<?php
# The side-bar section of the layout use custom path to load from a different folder.
include("sidebar.php");

# The footer section of the layout.
include("../../includes/footer.php");
?>