% lingua = Request.Querystring("lingua") Response.Buffer = True Dim strUrlSfondo Dim cartella 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") password = Request.Form("password") url_sito = Request.Form("url_sito") url_banner = Request.Form("url_banner") 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 'Verifica se la Login è già presente nel DB. strSql_Controllo = "SELECT login FROM link 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.asp?flag=false&password="&password strAppo = strAppo& "&url_sito="&url_sito 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.asp?errore="&Errore&"&lingua=it") else strAppo = strAppo& "&errore="&Errore 'Response.Redirect("insert_banner.asp?errore="&Errore) end if end if objRs.Close Set objRs = Nothing oConn.Close Set oConn = Nothing response.redirect strAppo end if 'Ricerco l'ID massimo, nella tabella è valore univoco. strSqlIdMax = "SELECT MAX(id) FROM link" Set objRs = oConn.Execute(strSqlIdMax) 'objRs(0) contiene il max id della tabella login_db 'Preparo l'INSERT 'strNow = DateAdd("s",21600, FormatDateTime(Now,0)) strNow = FormatDateTime(Now,0) iDNuovo = objRs(0) + 1 strSQL = "INSERT INTO link " strSQL= strSQL& "(id,login,nome_sito,password,url_sito,data_creazione,data_modifica,url_banner,tipo_link,buffer1testo)" strSQL= strSQL& " VALUES " strSQL= strSQL& "("&iDNuovo&"," strSQL= strSQL& "'"&login&"'," 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')" 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 ' -------------------------------------------------------- strHTMLBody = "
WWW.PHOTOLANDSCAPES.NET
" strHTMLBody = strHTMLBody & "" strHTMLBody = strHTMLBody & "" strHTMLBody = strHTMLBody & " |