% dim num1 dim rndnum Randomize Do While Len(rndnum)<4 num1=CStr(Chr((57-48)*rnd+48)) rndnum=rndnum&num1 loop session("code")=rndnum %>