Zubrag.com
December 10, 2019, 01:02:04 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 Protection - drop down list?  (Read 8847 times)
PhiltheBear
Newbie
*
Posts: 2


« on: May 14, 2007, 08:38:46 AM »

This may have been requested before...

I like the password protection idea but I need a slightly different implementation as I'm allowing people to look at different webpages for which they will have been given a password. Specifically, it's to allow people to log in to look at wedding photos, but only for the wedding where they have the password. What I need is to enable a dropdown list of "user names" but then make them type in the password for that user.

I hope you can help

PhiltheBear

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


WWW
« Reply #1 on: May 16, 2007, 09:24:35 AM »

Yes, it is possible.

Replace this code:
<?php if (USE_USERNAME) echo 'Login:<br /><input type="input" name="access_login" /><br />Password:<br />'; ?>

with:

<?php
if (USE_USERNAME) {
  echo 'Login:<br /><select name="access_login">';
  foreach($LOGIN_INFORMATION as $username=>$pass) {
    echo "<option>$username</option>";
  }
  echo '</select><br />Password:<br />';
}
?>
Logged
PhiltheBear
Newbie
*
Posts: 2


« Reply #2 on: May 17, 2007, 09:30:25 AM »

That's great.

Many, many thanks. I hope some day that I can repay you.

PhiltheBear
Logged
joshkin20
Newbie
*
Posts: 2


« Reply #3 on: May 20, 2008, 05:46:44 PM »

do you have any information on how to direct the different users to their own page once the login is complete?
Logged
Pages: [1]
  Print  
 
Jump to:  

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