First let me say that this forum is the best!
My latest question is that of how do I create random passwords and email them to individuals when they register on my site.
My form is basic:
<html>
<head>
<title>Registration</title>
</head>
<body>
<form method="POST" action="../in_work/post_user.asp">
<font face="BernhardMod BT" color="#000080">First Name
<input type="text" name="First" size="20" style="font-family: BernhardMod BT; font-size: 10pt; color: #0000FF" tabindex="1"><br>
Last Name
<input type="text" name="Last" size="30" style="font-family: BernhardMod BT; font-size: 10pt; color: #0000FF" tabindex="2"><br>
Email Address
<input type="text" name="Email" size="40" style="font-family: BernhardMod BT; font-size: 10pt; color: #0000FF" tabindex="3"><br>
<br>
User Name
<input type="text" name="user" size="20" style="font-family: BernhardMod BT; font-size: 10pt; color: #0000FF" tabindex="4"><br>
<br>
<input type="submit" value="Submit" name="Submit"><input type="reset" value="Reset" name="Reset"></form>
</font>
</body>
</html>
and the post_user.asp is basic as well:
<%
Dim adoCon
Dim rsAddUser
Dim strSQL
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)};pwd=****; DBQ=" & Server.MapPath("../*******")
'adoCon.Open "DSN=**********"
Set rsAddUser = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT tblUsers.First, tblUsers.Last, tblUsers.Email, tblUsers.user FROM tblUsers;"
rsAddUser.CursorType = 2
rsAddUser.LockType = 3
rsAddUser.Open strSQL, adoCon
rsAddUser.AddNew
rsAddUser.Fields("First") = Request.Form("first")
rsAddUser.Fields("Last") = Request.Form("last")
rsAddUser.Fields("Email") = Request.Form("email")
rsAddUser.Fields("user") = Request.Form("user")
rsAddUser.Update
rsAddUser.Close
Set rsAddUser = Nothing
Set adoCon = Nothing
Response.Redirect "../index.htm"
%>
Can anyone tell me s..l..o..w..e..l..y.. what kind of changes I need to make to do what I asked above? I tried an autonumber in my database, but it tells me that I can only have one and it is for the user id. Then I tried just a random number and it comes up with a number about 10 characters long. I would like to randomize letters and numbers that total about 6 characters.
Thanks all that have helped in the past, and to those that will probably help me in the very near future.