Пример #1
0
<?php

session_start();
$sessionid = session_id();
require_once "searchpass.php";
require "../auth.php";
$logindb = new SearchPass("blog_entries", 0, "users", 10000);
$loginCheck = $logindb->gettingStuff($_POST["username"]);
$loginPass = $loginCheck[0]["password"];
$loginUser = $loginCheck[0]["username"];
echo $_POST["password"] . PHP_EOL . $loginPass . PHP_EOL;
function usercheck($yourpass, $ourname, $ourpass)
{
    if (Auth::attempt($yourpass, $ourpass)) {
        $_SESSION["logged_in"] = true;
        $_SESSION["username"] = $ourname;
        header("Location: /testblog.php");
    } else {
        $_SESSION["logged_in"] = false;
        $_SESSION["username"] = "******";
        $_SESSION["incorrect"] = true;
        header("Location: /testblog.php");
    }
}
usercheck($_POST["password"], $loginUser, $loginPass);
Пример #2
0
    <td id="tog_it" valign="center" class="tog_on" title="click to show/hide the Left Menu Panel" onclick="toggle_left();">
    <div style="width:10px;"></div>
    </td>

    <?php 
    }
    //end if....
}
?>



<td id="COL2" style="width:100%">
<?php 
if (usercheck()) {
    if (!isset($no_header)) {
        echo '<div style="min-height:450px;">';
    } else {
        echo '<div>';
    }
    if ($cur_page == 'index.php') {
        ?>
	<div class="no_print" id="USERMENU">Welcome <b><?php 
        echo rtext($_SESSION["adm_usr_info"]['first_name'] . ' ' . $_SESSION["adm_usr_info"]['last_name']);
        ?>
</b>
    &nbsp;<span style="color: #003366;">[<a href="<?php 
        echo DOC_ROOT_ADMIN;
        ?>
logout">Logout</a>]</span></div>