473,396 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Password Protection using ASP

I am attempting to password protect some web pages. I have following the instructions within the following article: Microsoft Knowledge Base Article - 301464 - How To Use Simple ASP Code to Password Protect Your ASP Pages. Every thing works fine. The am having a problem figuring out how to add additional usernames and passwords. It appears as though the code is only good for one user. Can anyone help me out. I have pasted the code below.

<html>
<head>
<title>Logon Form</title>
<%
Username="test"
Password="test"
Validated = "OK"
if Strcomp(Request.Form("User"),Username,1)=0 AND
Request.Form("password") = Password then
'Set the validation cookie and redirect the user to the original page.
Response.Cookies("ValidUser") = Validated
'Check where the users are coming from within the application.
If (Request.QueryString("from")<>"") then
Response.Redirect Request.QueryString("from")
else
'If the first page that the user accessed is the Logon page,
'direct them to the default page.
Response.Redirect "greenbar.asp"
End if
Else
' Only present the failure message if the user typed in something.
If Request.Form("User") <> "" then
Response.Write "<h3>Authorization Failed.</h3>" & "<br>" & _
"Please try again.<br>&#xa0;<br>"
End if
End if
%>
</head>
<body bgcolor="#FFFFFF">
<FORM ACTION=<%Response.Write "Logon.asp?"&Request.QueryString%>

method="post">
<h3>Greenbar Logon</h3>
<p>
Username:
<INPUT TYPE="text" NAME="User" VALUE='' size="20"></INPUT>
Password:
<INPUT TYPE="password" NAME="password" VALUE='' size="20"></INPUT>
<INPUT TYPE="submit" VALUE="Logon"></INPUT>
</FORM>
</body>
</html>

Nov 22 '05 #1
0 647

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: juglesh | last post by:
<body><div align="center"> <?php if (!isset($password)){ ?><form action="<?php $_SERVER; ?>" method="post"> type password here&nbsp;<input name="password" type="text" size="8"> then <input...
6
by: Geert-Pieter Hof | last post by:
Hello, My VB 6.0 application read and writes data from and to a MS Excel workbook, using the Microsoft.Jet.OLEDB.4.0 provider. Now I want to protect the Excel workbook with a password, but I...
10
by: Max | last post by:
Hello all, I am trying to protect a page within my site with a JS password scheme. Now I know JS can be quite easily "circumvented", but I came by a code below. My question is: 1. Is there...
7
by: Borked Pseudo Mailed | last post by:
Seeking feedback on Password Protection via Java/JavaScript ONLY (no cgi): SEE: http://online_tools.home.att.net/tools.html *AND* http://online_tools.home.att.net/extraCode.htm Thanks.
6
by: Frank L | last post by:
I have some accounting and tax receipting type applications, developed for charitable and non profit groups, that are exhibiting strange behaviour on a few of the 30 or 40 user machines. When...
3
by: Miro | last post by:
Why Password protect an MDB when someone can google and get a hack? Wondering if anyone else has thought of this and just said "oh well"... I plan to password protect an MDB where I have some...
0
by: btopenworld | last post by:
Hi I have been using two forms of password protection: A) On working web sites I use an ASP script that is included in every page requiring protection: uses session - works fine B) On...
22
by: teejayem | last post by:
Hi, I am new to programming with databases and was wanting some help. Is there any way to password protect an access database and access sent sql commands to it via vb.net code? Any help...
1
by: anco85 | last post by:
Hi. Im a total access and VB noob and require your much appreciated help. I have a table that list all the vehicles in our company. I created a form to view this information much easier with a...
16
by: Greg (codepug | last post by:
If one converts that .mdb into an .mde the code is secure but the tables can still be imported. Just for Very Basic protection, I have placed a Password on the database using the "Set Database...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.