Solved

Dropdown with usernames from database using Frontpage

Posted on 2006-06-23
4
228 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Extracting data from Salesforce visualforce page 1 198
importing  maven Project 5 257
bootstrap submit button 12 116
Online video resource for customers 3 117
In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. 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 :…
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now