WEB LISTING 2: Confirmation.asp <%@Language=vbscript%> <% dim RetVal dim NumberOfQuestions dim ErrorThrown NumberOfQuestions=oAuth.GetNumberOfPredefinedQuestions dim InvalidDataFields() j=0 for i=1 to NumberOfQuestions if Request.Form("PD" & i)<>"" then RetVal=oAuth.WriteDB(ucase(Request.ServerVariables ("Auth_User")),i,0,Request.Form("PD " & i)) if not retval then errorthrown=true else redim preserve InValidDataFields(j) InvalidDataFields(j)=i j=j+1 end if Next if Request.Form("Challenge")<>"" then RetVal=oAuth.WriteDB(ucase(Request.ServerVariables ("Auth_User")),0,1,Request.Form("Ch allenge")) if not retval then errorthrown=true else redim preserve InValidDataFields(j) invaliddatafields(j)="C" j=j+1 end if if Request.Form("Response")<>"" then RetVal=oAuth.WriteDB(ucase(Request.ServerVariables ("Auth_User")),0,2,Request.Form("Re sponse")) if not retval then errorthrown=true else redim preserve InValidDataFields(j) invaliddatafields(j)="R" j=j+1 end if if j>0 then call ValidationError(InvalidDataFields) else if ErrorThrown=True then call DatabaseWriteError else call Validated() end if end if Sub DatabaseWriteError Response.Write " System Error" Response.Write "

A System Error Has Occurred

" Response.write "


" Response.Write "

The system was unable to write your data to the database at this time.


" Response.Write "

Please use your browser's back button to return to the previous page and try to resubmit your data. If the problem persists, please contact your local help desk or system administration team.

" end sub Sub Validated Response.Write "Confirmation " Response.Write "

Personal Information Data Collection

" Response.write "


" Response.Write "

Thank you for submitting your personal information.


" Response.Write "

Your responses have been encrypted and written to the database for use with the self-service password application and for verifying your identity when calling the help desk.

" Response.Write "

If you wish to use the self-service application, please click here.

" end sub Sub ValidationError(DataFieldsInError) Response.Write " Data Validation Error" Response.Write "

Error: Data Missing From Required Field

" Response.write "


" Response.Write "

Please provide data for the following field(s):


" Response.Write "
" for k=0 to ubound(DataFieldsInError) if DataFieldsInError(k)<>"" then if isnumeric(datafieldsinerror(k)) then Response.Write "

" & oAuth.DisplayPreDefinedQuestion(DataFieldsInError(k)) & "


" else if datafieldsinerror(k)="C" then Response.Write "

Custom Challenge Question


" else Response.Write "

Response to Custom Challenge Question


" end if end if end if next End sub Response.Write "" %>