Forum Moderators: open

Message Too Old, No Replies

ASP Username and Password

         

asplearner2003

4:54 am on May 30, 2003 (gmt 0)

10+ Year Member



Hello all.

I am developing an asp site where I need to generate a unique number with alphabetic characters as user name (eg. M123412001 when other person registering his user name should be M123412002 and next M123412003 etc...) and password (with or without numbers) when one new user is registering the site and this user name and password have to send him to his email address automatically when all these process got over.

I just want to know how to do this using asp with access db?

liwei

5:23 am on May 30, 2003 (gmt 0)

10+ Year Member



As for the username, do it this way:
1.read the last user name, M12342008

2.split the name to 'M' and the right number.
M and 12342008
number=clng((right(name,8))

3.add 1 to the number.
number=number+1

4.reconstruct a name, such as newname="M"&cstr(number)
ok!

As for password: random generation.

Send email:

<%
SUB sendMail( fromWho, toWho, Subject, Body )
DIM myMail
SET myMail = Server.CreateObject("CDONTS.Newmail")
myMail.From = fromWho
myMail.To = toWho
myMail.Subject = Subject
myMail.Body = Body
myMail.Send
SET myMail = Nothing
END SUB

fromWho=email
toWho="mail@xxx.com"
Subject="xxxxxxxx"
Body = mbody
sendMail fromWho, toWho, Subject, Body

asplearner2003

5:39 am on May 30, 2003 (gmt 0)

10+ Year Member



hi liwei,

Thanks a lot

do u hav any idea from where i can hav the sample code for this becasue i am a beginner in asp