Created
June 17, 2011 19:36
-
-
Save codersatx/1032134 to your computer and use it in GitHub Desktop.
A login helper to use in conjunction with the login class.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define("BASEPATH","pathname"); | |
//To use this include it in the top of all pages you need to protect: | |
//<?php include_once('login_helper.php');?> | |
function authenticate($url = 'login.php') | |
{ | |
session_start(); | |
if( $_SESSION['authenticated'] == FALSE) | |
{ | |
header('Location:login.php'); | |
} | |
} | |
authenticate(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment