Zubrag.com
June 23, 2018, 02:29:46 AM *
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 protect multiple pages, but with ONLY password - no user name  (Read 10155 times)
0nlyme
Newbie
*
Posts: 4


« on: January 18, 2008, 06:31:18 PM »

Excellent script.. I read the thread on how to protect multiple pages with a user name/password (user1->page1, user2->page2, etc....), but is it possible to do this same function with only a password without a user name??



Thanks.

Logged
paximadia
Newbie
*
Posts: 4


« Reply #1 on: January 19, 2008, 01:53:18 AM »

Hi OnlyMe,

yes this is possible. In the password_protect.php file it is explained (starting from row 32):

--------------------------------------------------------------------
SAMPLE if you only want to request only password on login form.
Note: only passwords are listed

$LOGIN_INFORMATION = array(
  'root',
  'testpass',
  'passwd'
);

--------------------------------------------------------------------
The explanation is just text. The actual passwords start in row 52. So it is there that you add your password(s).

DO NOT FORGET, that in row 56 and 57 it says:
// request login? true - show login and password boxes, false - password box only
define('USE_USERNAME', true);

So on row 57, change the word true to false.
Logged
0nlyme
Newbie
*
Posts: 4


« Reply #2 on: January 19, 2008, 07:41:10 AM »

Yes I know that, but I was looking for information on how to assign multiple pages to multiple passwords. I saw examples where this can be done using both a user name and a password, but I want only a password for this, w/o user name.

Any ideas?


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


WWW
« Reply #3 on: January 19, 2008, 03:29:29 PM »

Hi Onlyme.
The process is the same as protecting with usernames/passwords, but password_protect.php needs to be setup to request passwords only (like paximadia suggested above).
Logged
0nlyme
Newbie
*
Posts: 4


« Reply #4 on: January 19, 2008, 05:51:41 PM »

Sorry but I'm not understanding. This is what I changed in the original file. All I'm getting is a blank password_protect.php page on the redirect no matter what password below I use to log in.
Can you point out where I'm going wrong please?
Below are my only edits to the original file. The show only password field is set too.

$LOGIN_INFORMATION = array(
  'root',
  'testpass',
  'passwd'
);

$REDIRECTS = array (
'root' => 'page3.php',
'testpass' => 'page2.php',
'passwd' => 'page3.php'
);


On the last line before the "?>" I have:

header('Location: '.$REDIRECTS[$login]);

My redirect pages contain on line 1 the redirect code as instructed by uding the url and ?help
Logged
0nlyme
Newbie
*
Posts: 4


« Reply #5 on: January 20, 2008, 10:59:56 AM »

Never mind guys, my friend (a programmer) gave me exactly what I needed.


Thanks
Logged
Tree
Newbie
*
Posts: 5


« Reply #6 on: March 24, 2009, 03:11:49 PM »

UGH!

Why does NOBODY ever tell what the actual answer was?  I'm searching searching searching for an answer to this and other similar issues, and all I find are posts wherein the problem is laid out, explained in sufficient detail, and the only follow-up post is "Never mind, somebody did it for me" or "email me the file, I'll fix it".  What is the point?  Tell us what the answer is!

Okay, back to hunting the rest of these forums for something actually useful...
Logged
Pages: [1]
  Print  
 
Jump to:  

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