Click to See Complete Forum and Search --> : Simple Verifacation Check Won't Work - why?


weee
08-02-2005, 03:42 PM
'm asking the user to enter a verifacation number for the form he is sending. Only if the numbers (the number he entered and the number in the session) ar equal the form will go to the next page.

The problem is that I can't get it right. Everytime the user enter a number and press submit the number not equals any more. I'm getting a new number from the session "digits"

I have this code:


verCodeFC = Request.form("verCode")

If verCodeFC <> "" Then
If Trim(verCodeFC) <> Trim(Join( Session("digits"), "" )) Then
verCodeError = "<b>Please insert the number</b>"
Else
verCodeError = ""
End If
Else
Session ("digits") = Null

Dim arrImages
ReDim arrImages(6)
Randomize
For i = 1 To 6
arrImages(i) = Int( 10 * Rnd() )
Next

Session ("digits") = arrImages
End If


Why it's working now as well?

How can I resolve it?

Thanks!

Bullschmidt
08-09-2005, 09:02 PM
Perhaps try changing this:

If Trim(verCodeFC) <> Trim(Join( Session("digits"), "" )) Then

To something like this (converting things to string):

If CStr(Trim(verCodeFC)) <> CStr(Trim(Join( Session("digits"), "" ))) Then

(Or perhaps you only need the CStr() on the first variable.)

weee
08-09-2005, 09:03 PM
I'll try it, thanks