%
Dim RS
Dim SQL
Dim Username
Dim Password
Dim Result
Dim Field
Dim JMail
Dim StudentEmail
Dim ParentEmail
Username = Request.Form("Username")
CPassword = Server.URLEncode(Request.Form("CPassword"))
NPassword = Server.URLEncode(Request.Form("NPassword"))
NPassword2 = Server.URLEncode(Request.Form("NPassword2"))
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
Result = Result & CheckData()
If Result = "" Then
Set RS = Server.CreateObject("ADODB.RecordSet")
SQL = "SELECT * FROM Users WHERE (Username = '" & Username & _
"' AND Password = '" & CPassword & "')"
RS.Open SQL, Application("CHINA_ConnectionString"), 2, 2
If RS.EOF Then
Result = Result & "ERROR: Username not found, or current password is incorrect."
Else
RS("Password") = NPassword
RS.Update
RS.Close
Set RS = Nothing
Response.Redirect "cpassword_end.asp"
End If
RS.Close
Set RS = Nothing
End If
End If
Function CheckData()
Dim Result
If Username = "" Then
Result = Result & "Username cannot be an empty string.
" & vbCrLf
End If
If CPassword = "" Then
Result = Result & "Please enter your current password.
" & vbCrLf
End If
If Len(NPassword) < 4 Then
Result = Result & "New password must be at least 4 characters long.
" & vbCrLf
End If
If NPassword <> NPassword2 Then
Result = Result & "New passwords do not match.
" & vbCrLf
End If
CheckData = Result
End Function
%>
China Tour 2000: Bulletin Board