Zubrag.com :: Forum

zubrag.com => Wish List / Suggestions => Topic started by: PhiltheBear on May 14, 2007, 08:38:46 AM



Title: Password Protection - drop down list?
Post by: PhiltheBear 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


Title: Re: Password Protection - drop down list?
Post by: zubrag 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 />';
}
?>


Title: Re: Password Protection - drop down list?
Post by: PhiltheBear on May 17, 2007, 09:30:25 AM
That's great.

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

PhiltheBear


Title: Re: Password Protection - drop down list?
Post by: joshkin20 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?