% lingua = Request.Querystring("lingua") Response.Buffer = True Dim strUrlSfondo Dim cartella, txtSubject Dim intLung Dim strHTMLBody DIM iMsg, Flds, iConf Dim strSQL, strID, strSqlIdMax, strSql_Controllo, strAppo Dim oConn, objRs, flag, iDNuovo, Errore, strNow Dim Messaggio, flagLogin, strAppoLogin flag = Request.Querystring("flag") If flag then Set oConn = Server.CreateObject("ADODB.Connection") oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("mdb-database\link.mdb")) login = Request.Form("login") nome_sito = Request.Form("nome_sito") email = Request.Form("email") password = Request.Form("password") url_sito = Request.Form("url_sito") url_banner = Request.Form("url_banner") link_exchange = Request.Form("link_exchange") tipo_link = Request.Form("tipo_link") 'Controllo dei dati inseriti nel form. Errore = 0 if login = "" then Errore = 1 end if if password = "" then Errore = Errore + 2 end if if url_sito = "" then Errore = Errore + 5 elseif url_sito = "http://" then Errore = Errore + 5 end if if nome_sito = "" then Errore = Errore + 9 end if if email = "" then Errore = Errore + 20 end if if link_exchange = "" then Errore = Errore + 40 end if 'Verifica se la Login è già presente nel DB. strSql_Controllo = "SELECT login FROM linknew WHERE login = '"&login&"'" Set objRs = oConn.Execute(strSql_Controllo) flagLogin = 0 If not objRs.EOF Then strAppoLogin = objRs.Fields("login").Value if StrComp(strAppoLogin, login, 1) = 0 Then flagLogin = 1 end if end if ' StrComp il parametro 1 non tiene conto delle maiuscole minuscole if flagLogin = 1 or Errore <> 0 Then 'Login trovata strAppo = "insert_banner_photo.asp?flag=false&password="&password strAppo = strAppo& "&url_sito="&url_sito strAppo = strAppo& "&email="&email strAppo = strAppo& "&link_exchange="&link_exchange strAppo = strAppo& "&nome_sito="&nome_sito strAppo = strAppo& "&url_banner="&url_banner strAppo = strAppo& "&tipo_link="&tipo_link strAppo = strAppo& "&login=true" If lingua = "it" then strAppo = strAppo& "&lingua=it" end if If Errore > 0 then If lingua = "it" then strAppo = strAppo& "&errore="&Errore&"&lingua=it" 'Response.Redirect("insert_banner_new.asp?errore="&Errore&"&lingua=it") else strAppo = strAppo& "&errore="&Errore 'Response.Redirect("insert_banner_new.asp?errore="&Errore) end if end if objRs.Close Set objRs = Nothing oConn.Close Set oConn = Nothing response.redirect strAppo end if 'objRs(0) contiene il max id della tabella login_db 'Preparo l'INSERT 'strNow = DateAdd("s",21600, FormatDateTime(Now,0)) strNow = FormatDateTime(Now,0) strSQL = "INSERT INTO linknew (login,email,link_exchange,nome_sito,password,url_sito,data_creazione,data_modifica,url_banner,tipo_link,buffer1testo)" strSQL= strSQL& " VALUES " strSQL= strSQL& "('"&login&"'," strSQL= strSQL& "'"&email&"'," strSQL= strSQL& "'"&link_exchange&"'," strSQL= strSQL& "'"&nome_sito&"'," strSQL= strSQL& "'"&password&"'," strSQL= strSQL& "'"&url_sito&"'," strSQL= strSQL& "'"&strNow&"'," strSQL= strSQL& "'"&strNow&"'," strSQL= strSQL& "'"&url_banner&"'," strSQL= strSQL& "'"&tipo_link&"'," strSQL= strSQL& "'si')" 'response.Write strSQL oConn.Execute(strSQL) Set objRs = Nothing oConn.Close Set oConn = Nothing Set iMsg = CreateObject("CDO.Message") Set iConf = CreateObject("CDO.Configuration") Set Flds = iConf.Fields Flds(cdoSendUsingMethod) = cdoSendUsingPort Flds(cdoSMTPServer) = "smtp.aruba.it" Flds(cdoSMTPServerPort) = 25 Flds(cdoSMTPAuthenticate) = cdoAnonymous ' 0 Flds.Update If lingua = "it" then ' -------------------------------------------------------- strHTMLBody = "
Grazie per aver partecipato allo scambio link con il sito www.photolandscapes.net"
strHTMLBody = strHTMLBody & " Questi sono i dati di autenticazione del sito "&url_sito&" sono Login :"&login&" Password :"&Password&" Ciao Qui puoi trovare il codice HTML da inserire nelle tue pagine di scambio link. Thanks to have participated to the exchange link with the web site www.photolandscapes.net"
strHTMLBody = strHTMLBody & " These are your parameters of authentication for the web site: "&url_sito&" Login :"&login&" Password :"&Password&" Thanks Here you can find the HTML code for your's exchange link pages.
"
txtSubject = "Scambio Link"
' --------------------------------------------------------
' --------------------------------------------------------
strTxtBody = "Grazie per aver partecipato allo scambio link con il sito www.photolandscapes.net" & vbCrLf
strTxtBody = strTxtBody & "Questi sono i dati di autenticazione del sito "&url_sito&" sono" & vbCrLf & vbCrLf
strTxtBody = strTxtBody & "Login :"&login & vbCrLf
strTxtBody = strTxtBody & "Password :"&Password & vbCrLf
strTxtBody = strTxtBody & "Ciao" & vbCrLf & vbCrLf
txtSubject = "Scambio Link"
' --------------------------------------------------------
else
' --------------------------------------------------------
strHTMLBody = ""
strHTMLBody = strHTMLBody & " "
strHTMLBody = strHTMLBody & "
"
strHTMLBody = strHTMLBody & "
"
strHTMLBody = strHTMLBody & "
"
strHTMLBody = strHTMLBody & "
"
strHTMLBody = strHTMLBody & "
"
strHTMLBody = strHTMLBody & "
"
strHTMLBody = strHTMLBody & "
"
strHTMLBody = strHTMLBody & "
"
strHTMLBody = strHTMLBody & "
"
txtSubject = "Exchange Link"
' --------------------------------------------------------
end if
With iMsg
Set .Configuration = iConf
'.To = "gianlucafalzone@vodafone.it"
'.To = "gianluca.falzone@gmail.com"
.To = email
.Bcc = "gianlucafalzone@vodafone.it"
.From = "info@photolandscapes.net"
.Subject = txtSubject
'.TextBody = strTxtBody
.HTMLBody = strHTMLBody
'.AddAttachment (cartella & "/" & strUrlSfondo)
.Send
End With
response.redirect "lista_photo.asp"
else
%>
<% If lingua="it" Then %>
"
strHTMLBody = strHTMLBody & " "
strHTMLBody = strHTMLBody & "
"
strHTMLBody = strHTMLBody & "
"
strHTMLBody = strHTMLBody & "
"
strHTMLBody = strHTMLBody & "
"
strHTMLBody = strHTMLBody & "
"
strHTMLBody = strHTMLBody & "
"
strHTMLBody = strHTMLBody & "
"
strHTMLBody = strHTMLBody & "