%
'Option Explicit
On Error Resume Next
Dim RS
Dim SQL
Dim Username
Dim Password
Dim Result
Dim Field
Username = Request.Form("Username")
Password = Server.URLEncode(Request.Form("Password"))
If Username <> "" And Password <> "" Then
Set RS = Server.CreateObject("ADODB.RecordSet")
SQL = "SELECT * FROM Users WHERE (Username = '" & Username & _
"' AND Password = '" & Password & "')"
RS.Open SQL, Application("CHINA_ConnectionString"), 2, 2
If RS.EOF Then
Result = Result & "ERROR: Username not found, or password is incorrect."
ElseIf Not RS("Authorized") Then
Result = Result & "Your account has not been verified yet. Please try again later. " & vbCrLf
Else
For Each Field In Fields
Session(Field) = RS(Field)
Next
RS.Close
Set RS = Nothing
If Session("LOGIN_REDIRECT_URL") <> "" Then
Response.Redirect Session("LOGIN_REDIRECT_URL")
Else
Response.Redirect "default.asp"
End If
End If
RS.Close
Set RS = Nothing
End If
%>
China Tour 2000: Bulletin Board