Zubrag.com
May 20, 2012, 11:35:55 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: password protected page to redirect each user login to another page  (Read 4421 times)
State
Newbie
*
Posts: 1


« on: September 14, 2007, 09:47:50 pm »

Here's what I'm faced with... I'm looking to create a page for users to log in.

Based on correct username:password I need to redirect them to a specific page.

The pages will be created in either Word or Excel (saved as html).

I've tried following the steps I've found, but i seem to be having problems.

Is this correct?

// NOTE: all rows except last must have comma "," at the end of line
$LOGIN_INFORMATION = array(
  'zubrag' => 'root',
  'admin' => 'adminpass',
  'username1' => 'dumbass',
  'user1' => 'password'
);

// attempt to redirect user logins
$REDIRECTS = array (
'username1' => 'sample.php',
'admin' => 'test.php',
'user1' => 'test2.php'
);

// request login? true - show login and password boxes, false - password box only
define('USE_USERNAME', true);


Logged
zubrag
Administrator
Hero Member
*****
Posts: 753


WWW
« Reply #1 on: September 17, 2007, 07:58:05 am »

You missed few commas (marked with red).

Also following code has to be added just before the ending ?>

header('Location: '.$REDIRECTS[$login]);
Logged
Remnantpub
Newbie
*
Posts: 2


« Reply #2 on: March 29, 2010, 11:55:30 am »

I am trying to do the same, but using only the password.  I have made the changes above, but it is not redirecting.  Is there something I need to do differently or must I set the use username to true to get this to work?  Thanks!
Logged
zubrag
Administrator
Hero Member
*****
Posts: 753


WWW
« Reply #3 on: March 30, 2010, 02:18:13 am »

i think username is required for redirects to work
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC