Solved

Dropdown with usernames from database using Frontpage

Posted on 2006-06-23
4
232 Views
Last Modified: 2013-12-24
What I would like is on my login page have the usernames displayed in a dropdown list.  The user can choose their username from the list and then type in their password.

The database is called admin.mdb and the field I want to display is username

Thanks
0
Comment
Question by:Shaft960
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 2

Accepted Solution

by:
Eme-Eleonu earned 500 total points
ID: 16986877
Just plug this into your page

<!-- Start First Drop Down -->
<%
Set objDC = Server.CreateObject("ADODB.Connection")
objDC.Open Application("login_connectionstring")
Set objRS = objDC.Execute("SELECT Distinct username FROM Table")
%>
<FORM METHOD="POST" NAME="Form1">
<font face="Arial">Choose Your
    Username </font>
<SELECT NAME="username" SIZE="1" ONCHANGE=Form1.submit()>
<option selected><% = Request.Form("username") %></option>
<%
' Continue until we get to the end of the recordset.
Do Until objRS.EOF
' For each record we create a option tag and set it's value to the Department
%>

<OPTION><%= objRS("username") %></OPTION>
            <%
      ' Get next record
      objRS.MoveNext
      Loop
      %>
      </SELECT> </p>
      </FORM>
<%
' Close Data Access Objects and free DB variables
objRS.Close
Set objRS =  Nothing
objDC.Close
Set objDC = Nothing
%>
<!-- End first Drop Down -->

<!--Password Field-->
<%
'Some code to hide the password until we make a username is selected from the first
IF Request.Form("username") = "" Then
Else
'If username has a value then we allow user to enter password
%>
<FORM METHOD="POST" NAME="Form2">
<input type="password" name="Password" size="20">
<%
'Set a hidden value in the second form for the username
'so we can pass it along with the city to the next query %>
<input type="submit" value="Log In Now" name="Submit">
<input type="hidden" name="username" value="<% = Request.Form("username") %>"
</FORM>
<% End IF %>
<!-- End -->
0

Featured Post

Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question