Twitsnip is a place to post code snippets and share them. Login with your existing Twitter account, if you don't have a Twitter account simply create on at www.twitter.com

Login checker Functions

Login checker Functions

0

2 login functions that check if a user is logged in by checking is a session is equal to true that would have been set on login. If not logged in the redirect to login.php

function logged_in() {
	if($_SESSION['authorized'] == true) {
		return true;
	} else {
		return false;
	}
	
}
function login_required() {
	if(logged_in()) {	
		return true;
	} else {
		header('Location: login.php');
	}
	
}

Tags: login, functions

Comments

No comments yet

Login to Twitter to comment