Page 1 of 1

Login Protected Pages For Difference Users & redirected

Posted: Sun Dec 09, 2012 8:20 pm
by adex1
How To Use Below code:
Just download the password protect zip or attached wbs file (Ready to use without changes), unzip it and to go verify page right click it and change the code to below code:

Code: Select all

session_start();
	$userInfo = array(
		'user1' => array(
			'password' => 'password1',
			'page' => 'page1.php'
		),
		'user2' => array(
			'password' => 'password2',
			'page' => 'page2.php'
		),
		'user3' => array(
			'password' => 'password3',
			'page' => 'page3.php'
		),
		'user4' => array(
			'password' => 'password4',
			'page' => 'page4.php'
		),
		
	);

	if (array_key_exists($_POST['username'], $userInfo) && $userInfo[$_POST['username']]['password'] == $_POST['password']) {
		$page = 'http://yourdomainnamehere.com/logindemo/'. $userInfo[$_POST['username']]['page'];
		$_SESSION['username'] = $_POST['username'];
	}
	else {
		$page = 'http://yourdomainnamehere.com/filepath/login.php&login_error=1';
	}

	//echo $page .' here';exit();
	
	header('Location: '. $page);
More Details Here:

https://www.wysiwygwebbuilder.com/password_protect.html

Download:
https://www.wysiwygwebbuilder.com/suppor ... rotect.zip

OR