Skip to content

Instantly share code, notes, and snippets.

@evandrix
Forked from trietptm/gist:4468160
Created January 7, 2013 04:47

Revisions

  1. evandrix revised this gist Jan 7, 2013. No changes.
  2. @trietptm trietptm created this gist Jan 6, 2013.
    22 changes: 22 additions & 0 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    <?php
    //Note: PHP < 4.2.0 only
    $user = $_POST['user'];
    $pass = $_POST['pass'];

    if ($user->login($user, $pass)) {
    $loggedIn = true;
    if ($user->isAdmin()) {
    $priv = 1;
    }
    }

    // ...

    if (!$loggedIn) {
    include("login.php");
    } else if ($priv > 0) {
    include("admin.php");
    } else {
    include("intro.php");
    }
    ?>