Hello, I have code for making a reference number for payment. But it is not working now. Could any one take a look at it and give some suggestion how to modify so that it works. Or if there is some other way to make it, I do appreciate. Thanks a lot!
<script LANGUAGE="VBScript" >
Function referencenumber()
Randomize
Ref=1234567890
i = Len(Ref)
weightTable = Array(7, 3, 1)
tmpRef = 0
n = 0
Do While i > 0
tmpRef = tmpRef + Mid(Ref, i, 1) * weightTable(n)
i = i - 1
n = n + 1
If n > 2 Then n = 0
Loop
tmpRef = Int(Left(tmpRef, Len(tmpRef) - 1) & "0") + 10 - tmpRef
refTemp = Ref & Right(tmpRef, 1)
End Function
</script>
<%
dim referencenumber
response.write (Ref)
referencenumber = referencenumber()
Response.write (referencenumber)
a = Mid(refTemp, 1, 5)
b = Mid(refTemp, 6, 5)
c = Mid(refTemp, 10, 5)
Response.Write a & " " & b & " " & c
%>