Login Protected Pages For Difference Users & redirected

Do you want to share WYSIWYG Web Builder tips, tricks, tutorials or useful HTML code? You can post it here...
(no questions or problems please, this section is not monitored by support).
Forum rules
This section is to share tips, tricks and tutorials related to WYSIWYG Web Builder.
Please do not post questions or problems here. They will not be answered.

PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
Post Reply
adex1
 
 
Posts: 167
Joined: Fri Apr 01, 2011 1:13 pm

Login Protected Pages For Difference Users & redirected

Post 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:

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

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

OR
Buy Automation Shopping Cart for CMS WEBSHOP + 2.2 Using WB10!
- Use secure gateway to buy using PAYPAL website.
Post Reply