|
<%If (CStr(Request("Update")) <> "") Then
'get the user object
dim oUser, sRedirectURL, sHiddenPassword
Set oUser = New User
sHiddenPassword = oUser.CreateUID
'if the email already exists, redirect
'this eeds to be changed so that all are propeties of the user
'and the entries are checked for characters like "'"
oUser.UserName = request("username")
iCount = oUser.CheckUser
If iCount > 0 then
sRedirectURL = "register.asp?Error=True&username="&request("username")&iCount
'put the fields into an array
sFields = "EMail|WelcomeMessage|interests|WebURL"
arrFields = Split(sFields, "|")
For i = 0 to UBound(arrFields)
sRedirectURL = sRedirectURL & "&" & arrFields(i) & "=" & Request(arrFields(i))
Next
sRedirect = Replace(sRedirectURL," ", "+")
Response.Redirect(sRedirectURL)
Else
'add the record to the database
oUser.UserName = request("username")
oUser.EMail = request("email")
oUser.Password = sHiddenPassword
oUser.UserGroup = 3 'standard user
oUser.Marketable = request("allowemail")
oUser.BoardMessage = request("WelcomeMessage")
oUser.ShowEmail = request("ShowEMail")
oUser.Interests = request("Interests")
oUser.Title = request("Title")
oUser.FirstName = request("FirstName")
oUser.Surname = request("LastName")
oUser.Address1 = request("Street")
oUser.Address2 = request("Street2")
oUser.Town = request("Town")
oUser.PostCode = request("PostCode")
oUser.County = 0
oUser.Country = 0
oUser.URL = request("WebURL")
oUser.LastVisited = Date()
oUser.IPAddress = request.ServerVariables("REMOTE_ADDR")
oUser.CreateUser()
ON ERROR RESUME NEXT
Dim iMsg
Set iMsg = Server.CreateObject("CDO.Message")
Dim iBp
Dim Flds
Dim iConf
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
Flds(cdoSendUsingMethod) = cdoSendUsingPort
Flds(cdoSMTPServer) = "localhost"
Flds(cdoSMTPServerPort) = 25
Flds(cdoSMTPAuthenticate) = cdoAnonymous ' 0
Flds.Update
With iMsg
Set .Configuration = iConf
.To=Request("email")
.From="admin@apeaen.org"
.Subject="New User"
sBody = sBody & "Welcome to the apeaen.org forum."&Chr(13)
sBody = sBody & "We will soon be bringing you much more to your account including free forums and messageboards for your site,"
sBody = sBody & "a free image bank, free web pages, free voting booths and more.."&chr(13)&chr(13)
sBody = sBody & "Your Username is: " & request("username") & Chr(13)
sBody = sBody & "Your Password is: " & sHiddenPassword & Chr(13) & Chr(13)
sBody = sBody & "To find out more click here: " & Chr(13) & "http://apeaen.org"
.TextBody= sBody
'objMail.BodyFormat=0
'objMail.MailFormat=0
rst.Close
conn.Close
set conn = Nothing
.Send
End With
' Clean up variables.
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
End If
'clean up
Set oUser = Nothing%>
|
|
Thank you for registering to use the facilities on this site.
Your password will be sent to the e-mail address you specified.
back to Message Board Topics |
|
<%Else%>
<%End If%>
|
|
|
 |