Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Password Screen

0 views
Skip to first unread message

Jeremy Bassett

unread,
Jan 26, 2000, 3:00:00 AM1/26/00
to
I have to fields in a form for User Name and password
I want to check that they have entered SOMETHING first and then check
against a database WITHOUT letting the user see the password in the URL
displayed in the address bar.

This is the form:

<FORM name="form1" onsubmit="check()">

<TABLE WIDTH=485 CELLPADDING=2 CELLSPACING=2 BORDER=0>
<TR>
<TD COLSPAN=1 ROWSPAN=1 WIDTH=120></TD>
<TD COLSPAN=1 ROWSPAN=1 WIDTH=365></TD>
</TR>
<TR>
<TD>Login Name</TD>
<TD><INPUT TYPE="TEXT" NAME="LoginName" SIZE="51" MAXLENGTH="40"></TD>
</TR>
<TR>
<TD>Password</TD>
<TD><INPUT TYPE="PASSWORD" NAME="LoginPassword" SIZE="51"
MAXLENGTH="20"></TD>
</TR>
<TR>
<TD HEIGHT=35 COLSPAN=2 ALIGN="CENTER" VALIGN="BOTTOM"><INPUT TYPE="SUBMIT"
NAME="Login" VALUE=" Standard Login "><BR></TD>
</TR>
</TABLE>
</FORM>

This is what it calls to check non-blank fields:

<head>

<title>PerfectaWeb Design - Members Area</title>
<link rel="stylesheet" href="standardpage.css" type="text/css">

<script language="VBScript">
<!-- Activate Cloaking Device
Sub check()
If form1.LoginName.value = "" then
MsgBox "You must enter a UserName"
ElseIf IsNull(form1.LoginPassword.value) then
MsgBox "You must enter a Password"
Else window.open("LoginCheck.asp")
End If
End Sub
-->
</script>
</head>

And then I was going to check against a database:

<%
Dim mySQL
Dim connect_obj
Dim record_obj
' --- this code opens the database ---
set connect_obj=Server.CreateObject("ADODB.Connection")
set record_obj=Server.CreateObject("ADODB.Recordset")
'This works with the SYSTEM DSN
connect_obj.Open "DSN=PasswordSystemDSN"
' --- this code retrieves the data ---
mySQL="SELECT * FROM PasswordTable WHERE (((PasswordTable.UserID)=" &
form1.LoginName.value & "))"
record_obj.Open mySQL, connect_obj
%>

Is this the correct way of going about this? I am having a lot of problems
in getting this to work. The database does not want to connect but will a
few minutes later. Is this a Server thing. I am using NT4 SP5 IIS4. Please
help this is driving me crazy!!!

TIA

Jez

Dragon

unread,
Jan 26, 2000, 3:00:00 AM1/26/00
to
What is the name of the page where you are putting in the login and password
and what is the name of the page that you use to check the password against
a db?
One problem is that you are calling "form1.LoginName.value " in your SQL
statement and that will not work as it is SERVER side code and the
form1.LoginName.value will only work client side what you should use in the
db code is request("LoginName") instead of form1.LoginName.value.

If you do a lot of work in ASP I recommend getting a book on ASP. A good one
is Beginning Active Server Pages 2.0 by Wrox Press. You really need to
understand what is running on the server and what runs on the client. The
sub check will run on the client (the browser) but the database code will
run on the server. This means if you need client input values in your
server code then you will have to have the client submit a form and then
access those form variables using request("FormVarName") format.


Jeremy Bassett <j...@perfecta-computr.demon.co.uk> wrote in message
news:948849694.17690.0...@news.demon.co.uk...

0 new messages