<% 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 & "
"
strHTMLBody = strHTMLBody & "

Link :"&nome_sito&"


" strHTMLBody = strHTMLBody & "

Url :"&url_sito&"


" strHTMLBody = strHTMLBody & "
" strHTMLBody = strHTMLBody & "
" ' -------------------------------------------------------- With iMsg Set .Configuration = iConf .To = "gianlucafalzone@vodafone.it" '.To = "gianlucafalzone@yahoo.com" .From = "info@photolandscapes.net" .Subject = nome_sito .TextBody = "Un nuovo sito web è stato aggiunto." '.HTMLBody = strHTMLBody '.AddAttachment (cartella & "/" & strUrlSfondo) .Send End With response.redirect "lista_webwebweb.asp" else %> <% If lingua="it" Then %>

<% Errore = Request.QueryString("errore") If Errore > 0 then Response.Write("") Response.Write("") Response.Write("") end if %>

Inserisci il tuo Sito Web

Attenzione: Non saranno approvati siti e banners dai contenuti pornografici, discriminatori, razzisti o ritenuti offensivi alla dignità dei diritti umani o lesivi ai danni di terzi. Non saranno altresì accettati siti che contengono prodotti o servizi a pagamento se non sono indicati chiaramente nella pagina di accesso. Qualora venissero inseriti siti non in linea con queste avvertenze e con le condizioni generali dei servizi, saranno rimossi senza alcun preavviso o comunicazione. Siti già approvati che, successivamente all'approvazione, immettono contenuti non in linea con queste avvertenze e con le condizioni generali dei servizi, saranno rimossi senza alcun preavviso o comunicazione. Controlli periodici a campione sono effettuati dall'amministratore di sistema o su segnalazioni ricevute.

") Response.Write("

") Select Case Errore Case "1" Messaggio = "Il campo Login non è stato debitamente compilato" Case "2" Messaggio = "Il campo Password non è stato debitamente compilato" Case "3" Messaggio = "I campi Login e Password non sono stati debitamente compilati" Case "5" Messaggio = "Il campo Url Sito non è stato debitamente compilato" Case "6" Messaggio = "I campi Login e Url Sito non sono stati debitamente compilati" Case "7" Messaggio = "I campi Password e Url Sito non sono stati debitamente compilati" Case "8" Messaggio = "I campi Login, Password e Url Sito non sono stati debitamente compilati" Case "9" Messaggio = "Il campo Nome del Sito non è stato debitamente compilato" Case "10" Messaggio = "I campi Login e Nome del Sito non sono stati debitamente compilati" Case "11" Messaggio = "I campi Password e Nome del Sito non sono stati debitamente compilati" Case "12" Messaggio = "I campi Login, Password e Nome del Sito non sono stati debitamente compilati" Case "14" Messaggio = "I campi Url Sito e Nome del Sito non sono stati debitamente compilati" Case "15" Messaggio = "I campi Login, Url Sito e Nome del Sito non sono stati debitamente compilati" Case "16" Messaggio = "I campi Password, Url Sito e Nome del Sito non sono stati debitamente compilati" Case "17" Messaggio = "I campi Login, Password, Url Sito e Nome del Sito non sono stati debitamente compilati" End Select Response.Write(Messaggio) Response.Write("

*Login:

<% login = Request.Querystring("login") response.write "" If login then 'Login esistente If Errore = 0 then response.write " Attenzione Login Esistente!!!!" end if Else 'OK login corretta end if %>
*Password: <% password = Request.Querystring("password") response.write "" %>
*Titolo del Sito:

Max 100 caratteri

<% nome_sito = Request.Querystring("nome_sito") response.write "" %>
*URL Sito: <% If login then url_sito = Request.Querystring("url_sito") response.write "" else response.write "" end if %>
URL Banner: <% If login then url_banner = Request.Querystring("url_banner") response.write "" else response.write "" end if %>
Tipo di Sito: <% tipo_link = Request.Querystring("tipo_link") response.write "" elseif tipo_link = "photography" then response.write "

* = Campi Obbligatori.

Versione in Inglese

<% else %>

<% Errore = Request.QueryString("errore") If Errore > 0 then Response.Write("") Response.Write("") Response.Write("") end if %>

Add Your Web Site

Submit a link to your photographic web site and it will immediately appear in database. Moreover I am happy to exchange links with quality sites. Thank you!

Attention: Web sites, links and banners which contain material either pornographic, racialist, offensive to human rights or damaging to third parties will not be approved . We also will not approve sites which contain payable services or products. Sites which do not comply to these rules and regulations will be removed without notice or written comunication.

") Response.Write("

") Select Case Errore Case "1" Messaggio = "The Login is Empty" Case "2" Messaggio = "The Password is Empty" Case "3" Messaggio = "The Login and Password are Empty" Case "5" Messaggio = "The Url Site is Empty" Case "6" Messaggio = "The Login and Url Site are Empty" Case "7" Messaggio = "The Password and Url Site are Empty" Case "8" Messaggio = "The Login, Password and Url Site are Empty" Case "9" Messaggio = "The Title of the Site is Empty" Case "10" Messaggio = "The Login and Title of the Site are Empty" Case "11" Messaggio = "The Password and Title of the Site are Empty" Case "12" Messaggio = "The Login, Password and Title of the Site are Empty" Case "14" Messaggio = "The Url Site and Title of the Site are Empty" Case "15" Messaggio = "The Login, Url Site and Title of the Site are Empty" Case "16" Messaggio = "The Password, Url Site and Title of the Site are Empty" Case "17" Messaggio = "The Login, Password, Url Site and Title of the Site are Empty" End Select Response.Write(Messaggio) Response.Write("

*Login:

<% login = Request.Querystring("login") response.write "" If login then 'Login esistente If Errore = 0 then response.write " Attenzione Login Esistente!!!!" end if Else 'OK login corretta end if %>
*Password: <% password = Request.Querystring("password") response.write "" %>
*Title of the Site:

Length Max 100

<% nome_sito = Request.Querystring("nome_sito") response.write "" %>
*URL Site: <% If login then url_sito = Request.Querystring("url_sito") response.write "" else response.write "" end if %>
URL banner: <% If login then url_banner = Request.Querystring("url_banner") response.write "" else response.write "" end if %>
Type of Site Web: <% tipo_link = Request.Querystring("tipo_link") response.write "" elseif tipo_link = "photography" then response.write "

* = Mandatory fields.

Italian Version

<% end if %> <% end if Response.end Response.Clear %>