Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

zanelati2002

Como que faço para fazer isto

Recommended Posts

olá amigos já postei em varios forum mais nunca obtive exodo sou novo nesta programação em asp, tenho um codigo o phin_login que todos conhecem gostaria de mandar com ele depois que user se cadastrasse uma mensagem de agradecimento para ele no email dele como isto mais ou menos

Confirmação de cadastro Site do ZanelatiOlá Ricardo, seus dados para acesso no AspWeb são:Login:zanelati2002Senha:mundo22Obrigado por se cadastrar!Atenção!Caso haja inatividade em sua conta por mais de três meses seu cadastro será removido.Site do Zanelati

so que ninguem me ajuda peço a juda deste forum para que me ajude o codigo esta ai

<%Option ExplicitDim sql, rsUser, username, password, passwordconfirm, firstname, surname, email, dob, ---, notfilled(7), badflag, count, passwordLength, calltype, icon, starsign, dobmonth, dobday, sendemail'Assign form values to variablesusername = Request.Form("username")'Make sure they've not put any quotation marks in their usernameIf InStr(username,chr(34)) <> 0 or InStr(username,chr(39)) <> 0 then	errorfunction("invalidchars")end iffirstname = Request.Form("firstname")surname = Request.Form("surname")email = Request.Form("email")--- = Request.Form("---")password = Request.Form("password")passwordconfirm = Request.Form("passwordconfirm")dob = Request.Form("birth_day") & "/" & Request.Form("birth_month") & "/" & Request.Form("birth_year")icon = Request.Form("icon")'Only way to set a variable from a checkbox:if Request.Form("sendemail") = "on" then sendemail = True else sendemail = False end if'Check everything's been filled in, badflag determines whether error function is calledbadflag = 0'nofilled() is an array that will store the fields which are not filled inif firstname = "" then	notfilled(0) = "First Name"	badflag = 1end ifif surname = "" then	notfilled(1) = "Surname"	badflag = 1end ifif email = "" then	notfilled(2) = "Email"	badflag = 1end ifif username = "" then	notfilled(3) = "Username"	badflag = 1end ifif password = "" then	notfilled(4) = "Password"	badflag = 1end ifif --- = "" then	notfilled(5) = "---"	badflag = 1end ifif IsDate(dob) = "False" then	notfilled(6) = "Date of Birth"	badflag = 1end ifif icon = "" then	notfilled(7) = "Your choice of icon"	badflag = 1end ifif badflag = 1 then	signuperror()end if'Check password length is between 5 and 15 characters longpasswordLength = Len(password)if passwordLength < 5 or passwordLength > 15 then	errorfunction("length")end if'Check password and confirmed password are the sameif password <> passwordconfirm then	errorfunction("confirm")end if'Open connection and insert user details into the database%><!--#include file="conn.asp"--><%'For a bit of profiling fun, get their star signgetstarsign()'Then add it to the database. It's in a seperate function because we need to error trap to see if there's been a duplicate entry. It's not good form to have On Error Resume Next throughout your whole pageUserUpdate()Function UserUpdate()On Error Resume NextSet rsUser = Server.CreateObject("ADODB.Recordset")rsUser.open "users", conn, 3, 3rsUser.AddNewrsUser("username") = usernamersUser("password") = passwordrsUser("firstname") = firstnamersUser("surname") = surnamersUser("email") = emailrsUser("dob") = dobrsUser("starsign") = starsignrsUser("---") = sexrsUser("icon") = iconrsUser("sendemail") = sendemailrsUser.Updateif Err.Number = -2147217887 then	Err.clear	errorfunction("badusername")else	'Set username cookie to sign them in now	Response.Cookies("username") = username%><html><head><title>Philweb - Free ASP Applications</title></head><body bgcolor="#FFFFFF" link="#DD0000" vlink="#DD0000" alink="#000000"><font face="arial,helvetica" size=2>  <p><b>Obrigado por se cadastrar<%=firstname%> <%=surname%></b></p>  <p><b>Você agora possui um nome de usuário <%=username%> e está   logado!</b></p>  <p><a href="index.asp">Clique aqui para voltar á página inicial</a><p>  </font>  </td></tr></table></body></html><%rsUser.closeset rsUser = nothingconn.closeset conn = nothing%><%end ifEnd Function%><%Function getstarsign()dobmonth = Request.Form("birth_month")dobday = Request.Form("birth_day")Select Case dobmonth	Case 1  if dobday < 21 then 	 starsign = "Capricorn"  else 	 starsign = "Aquarius"  end if	Case 2  if dobday < 20 then 	 starsign = "Aquarius"  else 	 starsign = "Pisces"  end if	Case 3  if dobday < 21 then 	 starsign = "Pisces"  else 	 starsign = "Aries"  end if	Case 4  if dobday < 21 then 	 starsign = "Aries"  else 	 starsign = "Taurus"  end if	Case 5  if dobday < 22 then 	 starsign = "Taurus"  else 	 starsign = "Gemini"  end if	Case 6  if dobday < 22 then 	 starsign = "Gemini"  else 	 starsign = "Cancer"  end if	Case 7  if dobday < 24 then 	 starsign = "Cancer"  else 	 starsign = "Leo"  end if	Case 8  if dobday < 24 then 	 starsign = "Leo"  else 	 starsign = "Virgo"  end if	Case 9  if dobday < 24 then 	 starsign = "Virgo"  else 	 starsign = "Libra"  end if	Case 10  if dobday < 24 then 	 starsign = "Libra"  else 	 starsign = "Scorpio"  end if	Case 11  if dobday < 23 then 	 starsign = "Scorpio"  else 	 starsign = "Sagittarius"  end if	Case 12  if dobday < 22 then 	 starsign = "Sagittarius"  else 	 starsign = "Capricorn"  end ifEnd SelectEnd Function%><%Function signuperror()%><html><head><title>Philweb - Free ASP Applications</title></head><body bgcolor="#FFFFFF" link="#DD0000" vlink="#DD0000" alink="#000000"><font face="arial,helvetica" size=2><p><b>You have not filled in the following fields correctly:</b></p><%for count = 0 to 7%>	<%if notfilled(count) <> "" then%>	<b><%=notfilled(count)%></b><br>	<%end if%><%next%><p><a href="javascript:self.history.go(-1)">Please try again</a></p></font></table></body></html><%Response.endEnd Function%><%Function errorfunction(calltype)%><html><head><title>Philweb - Free ASP Applications</title></head><body bgcolor="#FFFFFF" link="#DD0000" vlink="#DD0000" alink="#000000"><font face="arial,helvetica" size=2><%if calltype = "confirm" then%><p><b>Your password and confirmed password were not the same</b></p><p><a href="javascript:self.history.go(-1)">Please try again</a></p></font></body></html><%Response.end%><%elseif calltype = "length" then%><p><b>Your password is not between 5 and 15 characters long</b></p><p><a href="javascript:self.history.go(-1)">Please try again</a></p></font></body></html><%Response.end%><%elseif calltype = "badusername" then%><p><b>Sorry, the username "<%=username%>" already exists.</b></p><p><a href="javascript:self.history.go(-1)">Please try again</a></p></font></body></html><%rsUser.closeset rsUser = nothingconn.closeset conn = nothingResponse.end%><%elseif calltype = "invalidchars" then%><p><b>Sorry, your username cannot contain any quotation marks.</b></p><p><a href="javascript:self.history.go(-1)">Please try again</a></p></font></body></html><%Response.end%><%end ifEnd Function%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Depois desta linharsUser("---") = sexrsUser("icon") = iconrsUser("sendemail") = sendemailrsUser.Updatebast avc poe um code para enviar email atraves do cdonts, aspmeail ou sei la que seu provedro aguentaai poe a mensagem simples

Compartilhar este post


Link para o post
Compartilhar em outros sites

então quer dizer que esta errado deste jeito pois ele esta dando erro na linha 263

<%Option ExplicitDim sql, rsUser, username, password, passwordconfirm, firstname, surname, email, dob, ---, notfilled(7), badflag, count, passwordLength, calltype, icon, starsign, dobmonth, dobday, sendemail'Assign form values to variablesusername = Request.Form("username")'Make sure they've not put any quotation marks in their usernameIf InStr(username,chr(34)) <> 0 or InStr(username,chr(39)) <> 0 thenerrorfunction("invalidchars")end iffirstname = Request.Form("firstname")surname = Request.Form("surname")email = Request.Form("email")--- = Request.Form("---")password = Request.Form("password")passwordconfirm = Request.Form("passwordconfirm")dob = Request.Form("birth_day") & "/" & Request.Form("birth_month") & "/" & Request.Form("birth_year")icon = Request.Form("icon")'Only way to set a variable from a checkbox:if Request.Form("sendemail") = "on" then sendemail = True else sendemail = False end if'Check everything's been filled in, badflag determines whether error function is calledbadflag = 0'nofilled() is an array that will store the fields which are not filled inif firstname = "" thennotfilled(0) = "First Name"badflag = 1end ifif surname = "" thennotfilled(1) = "Surname"badflag = 1end ifif email = "" thennotfilled(2) = "Email"badflag = 1end ifif username = "" thennotfilled(3) = "Username"badflag = 1end ifif password = "" thennotfilled(4) = "Password"badflag = 1end ifif --- = "" thennotfilled(5) = "---"badflag = 1end ifif IsDate(dob) = "False" thennotfilled(6) = "Date of Birth"badflag = 1end ifif icon = "" thennotfilled(7) = "Your choice of icon"badflag = 1end ifif badflag = 1 thensignuperror()end if'Check password length is between 5 and 15 characters longpasswordLength = Len(password)if passwordLength < 5 or passwordLength > 15 thenerrorfunction("length")end if'Check password and confirmed password are the sameif password <> passwordconfirm thenerrorfunction("confirm")end if'Open connection and insert user details into the database%><!--#include file="conn.asp"--><%'For a bit of profiling fun, get their star signgetstarsign()'Then add it to the database. It's in a seperate function because we need to error trap to see if there's been a duplicate entry. It's not good form to have On Error Resume Next throughout your whole pageUserUpdate()Function UserUpdate()On Error Resume NextSet rsUser = Server.CreateObject("ADODB.Recordset")rsUser.open "users", conn, 3, 3rsUser.AddNewrsUser("username") = usernamersUser("password") = passwordrsUser("firstname") = firstnamersUser("surname") = surnamersUser("email") = emailrsUser("dob") = dobrsUser("starsign") = starsignrsUser("---") = sexrsUser("icon") = iconrsUser("sendemail") = sendemailrsUser.Updateif Err.Number = -2147217887 thenErr.clearerrorfunction("badusername")else'Set username cookie to sign them in nowResponse.Cookies("username") = username%><%' Atribuindo os dados do formulário submetido as váriveis strNome estrEmail' strNome = Trim(Request.Form("username"))strEmail = Trim(Request.Form("email"))' Agora vamos criar uma conexão com o JMAIL para enviar os dados' submetidos para o webmaster do site.' O Email será enviado pelo usuário recém cadastradoSet objMail = Server.CreateObject("JMail.SMTPMail")objMail.ServerAddress = "mail.libihost.net"ObjMail.Logging = TrueObjMail.Sender = "sitedozanelati@ig.com.br"ObjMail.SenderName = "WebMaster"objMail.From = strEmailobjMail.Subject = "Cadastro no site!"' Vamos criar agora uma mensagem padrão a ser enviado para o webmaster' vbcrlf = quebra de linhastrMsgParaCadastro = "Nome: " & strusername & vbcrlfstrMsgParaCadastro = strMsgParaCadastro & "Email: " & stremail & vbcrlfstrMsgParaCadastro = strMsgParaCadastro & "-----------------------------"objMail.Body = strMsgParaCadastroObjMail.ExecuteobjMail.Send' Email para o webmaster enviado, portanto fechamos a conexão com oJMAILSet objMail = nothing' Agora imediatamente, criamos a mensagem padrão que será enviadade agradecimento' ao usuário recém cadastrado.strMsgObrigado = "Olá " & strusername & vbcrlfstrMsgObrigado = strMsgObrigado & "Obrigado por se cadastrar em nossosite" & vbcrlfstrMsgObrigado = strMsgObrigado & "Breve você receberá mais informações."& vbcrlf & vbcrlfstrMsgObrigado = strMsgObrigado & "Abraços," & vbcrlfstrMsgObrigado = strMsgObrigado & "Webmaster"' Criando novamente outra conexão com o JMAIL para enviar o emailao usuário.Set objMail = Server.CreateObject("JMail.SMTPMail")objMail.ServerAddress = "mail.libihost.net"ObjMail.Logging = TrueobjMail.From = "sitedozanelati@ig.com.br"objMail.To = strEmail ' observeobjMail.Subject = "Seu cadastro em nosso site!"objMail.Body = strMsgObrigadoobjMail.Send%><html><head><title>Philweb - Free ASP Applications</title><title>Philweb - Free ASP Applications</title><title>Philweb - Free ASP Applications</title></head><body bgcolor="#FFFFFF" link="#DD0000" vlink="#DD0000" alink="#000000"><font face="arial,helvetica" size=2> <p><b>Obrigado por se cadastrar<%=firstname%> <%=surname%></b></p> <p><b>Você agora possui um nome de usuário <%=username%> e está  logado!</b></p> <p><a href="index.asp">Clique aqui para voltar á página inicial</a><p> </font><font face="arial,helvetica" size=2><p><b>You have not filled in the following fields correctly:</b></p><%for count = 0 to 7%><%if notfilled(count) <> "" then%><b><%=notfilled(count)%></b><br><%end if%><%next%><p><a href="javascript:self.history.go(-1)">Please try again</a></p></font><font face="arial,helvetica" size=2><%if calltype = "confirm" then%><p><b>Your password and confirmed password were not the same</b></p><p><a href="javascript:self.history.go(-1)">Please try again</a></p></font><p><b>Your password is not between 5 and 15 characters long</b></p><p><a href="javascript:self.history.go(-1)">Please try again</a></p><p><b>Sorry, the username "<%=username%>" already exists.</b></p><p><a href="javascript:self.history.go(-1)">Please try again</a></p><p><b>Sorry, your username cannot contain any quotation marks.</b></p><p><a href="javascript:self.history.go(-1)">Please try again</a></p></body></html><%rsUser.closeset rsUser = nothingconn.closeset conn = nothing%><%end ifEnd Function%><%Function getstarsign()dobmonth = Request.Form("birth_month")dobday = Request.Form("birth_day")Select Case dobmonthCase 1 if dobday < 21 then  starsign = "Capricorn" else  starsign = "Aquarius" end ifCase 2 if dobday < 20 then  starsign = "Aquarius" else  starsign = "Pisces" end ifCase 3 if dobday < 21 then  starsign = "Pisces" else  starsign = "Aries" end ifCase 4 if dobday < 21 then  starsign = "Aries" else  starsign = "Taurus" end ifCase 5 if dobday < 22 then  starsign = "Taurus" else  starsign = "Gemini" end ifCase 6 if dobday < 22 then  starsign = "Gemini" else  starsign = "Cancer" end ifCase 7 if dobday < 24 then  starsign = "Cancer" else  starsign = "Leo" end ifCase 8 if dobday < 24 then  starsign = "Leo" else  starsign = "Virgo" end ifCase 9 if dobday < 24 then  starsign = "Virgo" else  starsign = "Libra" end ifCase 10 if dobday < 24 then  starsign = "Libra" else  starsign = "Scorpio" end ifCase 11 if dobday < 23 then  starsign = "Scorpio" else  starsign = "Sagittarius" end ifCase 12 if dobday < 22 then  starsign = "Sagittarius" else  starsign = "Capricorn" end ifEnd SelectEnd Function%><%Function signuperror()%><%Response.endEnd Function%><%Function errorfunction(calltype)%><%Response.end%><%elseif calltype = "length" then%><%Response.end%><%elseif calltype = "badusername" then%><%rsUser.closeset rsUser = nothingconn.closeset conn = nothingResponse.end%><%elseif calltype = "invalidchars" then%><%Response.end%><%end ifEnd Function%>
o erro é o seguinte olha so

'If' esperado /sitedozanelati/login2/signupprocess3.asp, line 263 End Function

Compartilhar este post


Link para o post
Compartilhar em outros sites

Ta faltando ou sobrando um if reveja os if ou a criação dos functions

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.