Pagina 1 di 3 1 2 3 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 24
  1. #1

    Help! Non so inserire antispam in form guestbook ASP con DB

    Ragazzi, ragazze, è una settimana che provo ma non ci riesco, non conosco minimamente asp e sebbene abbia trovato script captcha di ogni tipo in Internet e su questo forum, non ho idea di cosa aggiungere per filtrare lo spam da questo guestbook. Vi prego, qualcuno mi aiuti! Sono disperata!
    Il guestbook è questo:http://www.bedandbreakfastilceppo.it...sp?action=sign

    Fede
    Immagini allegate Immagini allegate
    "Vivere è fare il soldato" - Seneca

  2. #2
    usa un captcha! su internet ne trovi quanti ne vuoi

  3. #3
    Ne ho trovati tanti, ma non ho idea di come inserirli...rimango con Dreamweaver aperto come un ebete e non so dove cappero infilare il codice...:-((((((((((((((
    "Vivere è fare il soldato" - Seneca

  4. #4
    a volte DW è un ostacolo alla programmazione ASP mi spiace, non so come aiutarti con DW

  5. #5
    Dimmi cosa devo usare e lo installo!
    "Vivere è fare il soldato" - Seneca

  6. #6
    per asp va benissimo anche il notepad!

  7. #7
    Ok. Rimane il problema. Cosa ci metto dentro e dove lo metto per inserire un captcha??
    "Vivere è fare il soldato" - Seneca

  8. #8
    posta il codice della pagina e il codice del captcha

  9. #9

    codice guestbook

    <%
    '/////////////////////////////////////////////////////
    ' Guestbook database
    ' format parameters
    '/////////////////////////////////////////////////////
    dim gb_db
    dim gb_colorHead, gb_colorMessage, gb_fontText, gb_fontEnd, gb_fontTool, gb_fontHead
    dim gb_pageSeparator,gb_pageSeparatorLong
    gb_pageSeparator=" "
    gb_pageSeparatorLong=" ... "
    gb_colorHead="FFCC43"
    gb_colorMessage="F2ECB6"
    gb_fontHead="<FONT SIZE=1 FACE=Arial,sans-serif COLOR=660000>"
    gb_fontText="<FONT SIZE=1 FACE=Arial,sans-serif COLOR=660000>"
    gb_fontTool="<FONT SIZE=1 FACE=Arial,sans-serif COLOR=660000>"
    gb_fontEnd="</FONT>"

    sub gb_SendMail(strFrom,strTo,strSubject,strBody) ' Uses CDONTS.NewMail object to send mail
    dim mail
    set mail=Server.CreateObject("CDONTS.NewMail")
    mail.From=strFrom
    mail.To=strTo
    mail.Subject=strSubject
    mail.Body=strBody
    mail.Send
    set mail=nothing
    end sub

    dim gb_aMonth(12)
    gb_aMonth(1)="Jan"
    gb_aMonth(2)="Feb"
    gb_aMonth(3)="Mar"
    gb_aMonth(4)="Apr"
    gb_aMonth(5)="May"
    gb_aMonth(6)="Jun"
    gb_aMonth(7)="Jul"
    gb_aMonth(8)="Aug"
    gb_aMonth(9)="Sep"
    gb_aMonth(10)="Oct"
    gb_aMonth(11)="Nov"
    gb_aMonth(12)="Dec"
    function gb_show_datetime(dt) ' show date and time
    dim s
    s=day(dt) & "." & gb_aMonth(month(dt)) & "." & year(dt) & " "
    dim sm
    sm=":" & minute(dt)
    if len(sm)=2 then sm=":0" & minute(dt)
    s=s & hour(dt) & sm
    gb_show_datetime=s
    end function

    function gb_encode_html(str) ' like Server.HTMLEncode(...)
    str=replace(str,"&","&amp;")
    str=replace(str,"<","&lt;")
    str=replace(str,">","&gt;")
    str=replace(str,"""","&quot;")
    gb_encode_html=str
    end function

    function gb_SQLDATE(d) ' make "#year/month/day#" from date
    dim strYear,strMonth,strDay
    strYear = CStr(Year(d))
    strMonth = CStr(Month(d))
    if Month(d) < 10 then
    strMonth = "0" & strMonth
    end if
    strDay = CStr(Day(d))
    if Day(d) < 10 then
    strDay = "0" & strDay
    end if
    SQLDATE="#" & strYear & "/" & strMonth & "/" & strDay & "#"
    end function

    function gb_doCode(str, oTag, cTag, roTag, rcTag) ' replace guestbook codes
    dim i,cnt,p,tmp,tmp1,url
    dim tx,t
    tx = split(str, cTag)
    t = ""
    for i = 0 to ubound(tx)
    if lcase(oTag) = "[a]" then
    p = instr(1, tx(i), "[a]", 1)
    if p <> 0 then
    tmp = mid(tx(i), p)
    url = mid(tmp, 4)
    if instr(1,url,":")>0 then
    tmp1 = Replace(tmp, "[a]"&url, "" & gb_fontText & url & gb_fontEnd & "", 1, -1, 1)
    else
    tmp1 = Replace(tmp, "[a]"&url, "" & gb_fontText & url & gb_fontEnd & "", 1, -1, 1)
    end if
    t =t & Replace(tx(i), tmp, tmp1)
    else
    t = t & tx(i)
    end if
    else
    cnt = instr(1,tx(i), oTag,1)
    select case cnt
    case 0
    t=t&tx(i) & " "
    case else
    t = t & Replace(tx(i), oTag, roTag,1,1,1)
    't = t & " " & rcTag & " "
    t = t & rcTag
    end select
    end if
    next
    gb_doCode = t
    end function

    Function gb_smile(s) ' replace smiles
    dim rsIcons
    set rsIcons=gb_db.Execute("SELECT * FROM icons")
    while not rsIcons.EOF
    dim strIcon
    strIcon="[img][/img]"
    s = replace(s, rsIcons("icon_code"), strIcon)
    rsIcons.MoveNext
    wend
    rsIcons.Close
    set rsIcons=nothing
    gb_smile = s
    End function

    Function gb_chkString(str)
    if str = "" then
    gb_chkString=""
    exit function
    End If

    dim rsAdmin
    set rsAdmin=gb_db.Execute("SELECT * FROM admin")

    if rsAdmin("allow_codes") then
    str = gb_doCode(str, "[a]", "[/a]", "<A>", "</A>")
    str = gb_doCode(str, "", "", "", "")
    str = gb_doCode(str, "", "", "", "")
    str = gb_doCode(str, "[c]", "[/c]", "<CENTER>", "</CENTER>")
    str = gb_doCode(str, "
    codice:
    ", "
    ", "<PRE>", "</PRE>")
    end if

    if rsAdmin("allow_icons") then
    str=gb_smile(str)
    end if
    rsAdmin.Close
    set rsAdmin=nothing

    ' Replace CR & LF with

    str = Replace(str, vbCrLf,"
    ")
    str = Replace(str, vbCr,"
    ")
    str = Replace(str, vbLf,"
    ")

    gb_chkString = str
    End Function

    sub gb_Write(byref s,s1)
    s=s+gb_fontText & s1 & gb_fontEnd
    end sub

    sub gb_Write1(byref s,s1)
    s=s+gb_fontHead & s1 & gb_fontEnd
    end sub

    sub gb_Write2(byref s,s1)
    s=s+gb_fontTool & s1 & gb_fontEnd
    end sub

    function gb_GetUrl
    dim url
    url="http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL")
    gb_GetUrl=url
    end function

    function gb_redirectToView(bUsePage)
    dim url
    url=gb_GetUrl
    if bUsePage And Request.QueryString("page")<>"" then url=url & "?page=" & Request.QueryString("page")
    Response.Redirect(url)
    Response.Flush
    Response.End
    end function

    Function gb_removeRecord
    gb_db.Execute("DELETE * FROM gb WHERE id=" & Request.QueryString("id"))
    gb_redirectToView true
    gb_removeRecord=""
    end Function
    "Vivere è fare il soldato" - Seneca

  10. #10

    2nda parte

    Function gb_editRecord
    dim s
    s=""
    dim r
    set r=gb_db.Execute("SELECT * FROM gb WHERE id=" & Request.QueryString("id"))

    if not r.EOF then
    s=s & "<FORM ACTION=""" & gb_GetUrl() & "?action=update&id=" & r("id") & """ METHOD=post NAME=edit>"
    s=s & "<TABLE CELLPADDING=2 CELLSPACING=0>"
    s=s & "<TR><TD ALIGN=center COLSPAN=2>"
    gb_Write2 s,"<BIG>[B]Edita record[B]</BIG>"
    s=s & "</TD></TR>"
    s=s & "<TR><TD VALIGN=top ALIGN=right>"
    gb_Write2 s,"Nome:"
    s=s & "</TD><TD><INPUT TYPE=text VALUE=""" & gb_encode_html(r("name")) & """ SIZE=40 NAME=name>"
    s=s & "</TD></TR>"

    s=s & "<TR><TD VALIGN=top ALIGN=right>"
    gb_Write2 s,"Nazione:"
    s=s & "</TD><TD><INPUT TYPE=text VALUE=""" & gb_encode_html(r("to")) & """ SIZE=40 NAME=to>"
    s=s & "</TD></TR>"

    s=s & "<TR><TD VALIGN=top ALIGN=right>"
    gb_Write2 s,"Email:"
    s=s & "</TD><TD><INPUT TYPE=text VALUE=""" & gb_encode_html(r("email")) & """ SIZE=40 NAME=email>"
    s=s & "</TD></TR>"

    s=s & "<TR><TD VALIGN=top ALIGN=right>"
    gb_Write2 s,"Messaggio:"
    s=s & "</TD><TD><TEXTAREA ROWS=7 COLS=45 NAME=text>" & r("text1") & "</TEXTAREA>"
    s=s & "</TD></TR>"

    s=s & "<TR><TD VALIGN=top ALIGN=right>"
    gb_Write2 s,"Risposta:"
    s=s & "</TD><TD><TEXTAREA ROWS=7 COLS=45 NAME=resp>" & r("resp") & "</TEXTAREA>"
    s=s & "</TD></TR>"

    s=s & "<TR><TD ALIGN=center COLSPAN=2><INPUT TYPE=submit VALUE=Update>"
    s=s & "</TABLE>"
    s=s & "</FORM>"
    end if

    r.Close
    set r=nothing

    gb_editRecord=s
    end Function

    Function gb_addRecord
    dim s
    s=""

    s=s & "<FORM ACTION=""" & gb_GetUrl() & "?action=submit"" METHOD=post id=form1 name=form1>"
    s=s & "<TABLE WIDTH=400 BORDER=0 CELLPADDING=0 CELLSPACING=3>"
    s=s & "<TR><TD COLSPAN=2 ALIGN=center><DIV STYLE=""margin: 10"">"
    gb_Write2 s,"<BIG>Vai al guestbook</BIG>***<BIG>Help</BIG>"
    s=s & "</TD></TR>"
    s=s & "<TR><TD ALIGN=center COLSPAN=2>"
    gb_Write2 s,"Si prega di riempire tutti i campi."
    s=s & "
    </TD></TR>"
    s=s & "<TR><TD VALIGN=top ALIGN=right>"
    gb_Write2 s,"Nome:"
    s=s & "</TD>"
    s=s & "<TD><INPUT TYPE=text SIZE=40 NAME=name></TD></TR>"
    s=s & "<TR><TD VALIGN=top ALIGN=right>"
    gb_Write2 s,"Email:"
    s=s & "</TD>"
    s=s & "<TD><INPUT TYPE=text SIZE=40 NAME=email></TD></TR>"
    s=s & "<TR><TD VALIGN=top ALIGN=right>"
    gb_Write2 s,"Nazione:"
    s=s & "</TD>"
    s=s & "<TD><INPUT TYPE=text SIZE=40 NAME=to></TD></TR>"
    s=s & "<TR><TD VALIGN=top ALIGN=right>"
    gb_Write2 s,"Messaggio:"
    s=s & "</TD>"
    s=s & "<TD><TEXTAREA NAME=text ROWS=7 COLS=45 WRAP=soft></TEXTAREA></TD></TR>"
    s=s & "<TR><TD COLSPAN=2 ALIGN=center>"
    s=s & "<INPUT TYPE=submit VALUE=""Invia""> "
    s=s & "<INPUT TYPE=reset VALUE=""Annulla"">"
    s=s & "</TD></TR>"
    s=s & "</TABLE></FORM>"

    gb_addRecord=s
    end Function
    "Vivere è fare il soldato" - Seneca

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.