%
sUserName = Request.Form("username")
sName = Request.Form("name")
sEmail = Request.Form("email")
sAddressOne = Request.Form("addressone")
sAddressTwo = Request.Form("addresstwo")
sCity = Request.Form("city")
sState = Request.Form("state")
sZip = Request.Form("zip")
Call OpenDBConn
Call DoPageHeader
Response.Write("")
If Len(Trim(sUserName)) = 0 Then
sString = sString & "Há um problema com o campo ""USER NAME"" .
"
End If
If Len(Trim(sName)) = 0 Then
sString = sString & "Há um problema com o campo ""NAME"" .
"
End If
If Len(Trim(sEmail)) = 0 Then
sString = sString & "Há um problema com o campo ""EMAIL"" .
"
End If
If Len(Trim(sAddressOne)) = 0 Then
sString = sString & "Há um problema com o campo ""Address 1"" .
"
End If
If Len(Trim(sCity)) = 0 Then
sString = sString & "Há um problema com o campo ""CITY"" .
"
End If
If sState = "other" Then
sString = sString & "Há um problema com o campo ""STATE"" .
"
End If
If Len(Trim(sZip)) = 0 Then
sString = sString & "Há um problema com o campo ""Zip Code"" .
"
End If
If sString <> "" Then
Response.Write ("
" & sString & "Por favor clique no botão ""RETROCEDER"" do seu browser para tentar de novo.")
Else
Call CheckName
End If
Call DoPageFooter
Sub CheckName
sSQl = ""
sSQL = sSQL & "SELECT COUNT(*) as Total FROM registration WHERE username = " & SQLStr(sUserName)
Set CountRS = GobjConnect.Execute(sSQL)
If CountRS.Fields("Total") > 0 Then
Response.Write("The User Name you chose," & chr(34) & "" & sUserName & "" & chr(34) & ", has already been taken.
")
Response.Write("Por favor use o botão ""RETROCEDER"" do seu browser para tentar de novo.")
Else
Call InsertUser
End If
End Sub
Sub InsertUser
Randomize
sPassword = clng(rnd * 1000000) + 1000
npSQL = ""
npSQL = npSQL & " INSERT INTO Registration (username, password, Validated, Name, Email, Address1, Address2, City, State, Zip) "
npSQL = npSQL & " VALUES (" & SQLStr(sUserName) & ", "
npSQL = npSQL & SQLStr(sPassword) & " , "
If bUsersAdd = False Then
npSQL = npSQL & " false , "
Else
npSQL = npSQL & " true , "
End If
npSQL = npSQL & SQLStr(sName) & ", "
npSQL = npSQL & SQLStr(sEmail) & ", "
npSQL = npSQL & SQLStr(sAddressOne) & ", "
npSQL = npSQL & SQLStr(sAddressTwo) & ", "
npSQL = npSQL & SQLStr(sCity) & ", "
npSQL = npSQL & SQLStr(sState) & ", "
npSQL = npSQL & SQLStr(sZip) & " )"
GobjConnect.Execute(npSQL)
Response.Write("O seu registo foi feito com sucesso.
")
Call SendPassEmail(sPassword)
Response.Write("A sua password foi-lhe enviada por email.
")
Response.Write("Pode mudar a password clicando no link ""Mudar Password"" na home page.
")
Response.Write("Clique aqui para continuar.")
End Sub
Sub SendPassEmail(sPass)
sBody = ""
sBody = sBody & chr(10) & chr(13)
sBody = sBody & "EMAIL GERADO DE FORMA AUTOMÁTICA: NÃO RESPONDA A ESTE EMAIL" & chr(10) & chr(13)
sBody = sBody & "Obrigado por se registar nos leilões do figueiraonline.com!" & chr(10) & chr(13)
sBody = sBody & "Se tiver alguns comentários a fazer, contacte-nos! "
sBody = sBody & "Estes leilões são 100% GRÁTIS. "
sBody = sBody & "São um óptimo meio para vender tudo o que quiser. "
sBody = sBody & "E pelo melhor preço! "
sBody = sBody & chr(10) & chr(13)
sBody = sBody & chr(10) & chr(13)
sBody = sBody & "***** GUARDE ESTE EMAIL -- NÃO PERCA A SUA PASSWORD! *****" & chr(10) & chr(13)
sBody = sBody & " O seu user name é: " & sUserName & chr(10) & chr(13)
sBody = sBody & " A sua password é : " & sPass & chr(10) & chr(13)
sBody = sBody & chr(10) & chr(13)
sBody = sBody & chr(10) & chr(13)
sBody = sBody & chr(10) & chr(13)
sBody = sBody & "Pode mudar a sua password a qualquer altura indo a : " & sAuctPath & "changepassword.asp"
sBody = sBody & chr(10) & chr(13)
sBody = sBody & "" & sAuctPath
sBody = sBody & chr(10) & chr(13)
sBody = sBody & ""
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.RemoteHost = "" & mailsrv & ""
Mailer.AddRecipient " ","" & sEmail & ""
Mailer.FromName = "Leilões - figueiraonline.com"
Mailer.FromAddress = "" & emailsrv & ""
Mailer.Subject = "A sua password!"
Mailer.BodyText = sBody
if Mailer.SendMail then
Response.Write " "
else Response.Write "Houve um erro, contacte " & emailsrv & ". O erro foi "& Mailer.Response
end if
End Sub
%>