ok allora ho combinato un bel casino....
ora ho implementato nel file sign.asp il controllo captcha con numeri e lettere.. fin qui ci riesco ma il mio problema è inserire la procedura di controllo all'interno del file infatti anche se ometto di scrivere il controllo captcha il guest viene scritto uguale!! ti posto tutti i file e ti prego se puoi controllamelo tu!!
grazie angelo
File add.asp
codice:
<%
If blnCAPTCHAcodeCorrect = True Then
Response.Write(" CAPTCHA code is correct")
ElseIf blnCAPTCHAcodeCorrect = False Then
Response.Write(" CAPTCHA code is NOT correct")
End If
%>
<%
'------------------------------
'This script just add new entry
'------------------------------
name=Request.Form ("txtname")
email=Request.Form ("txtemail")
url=Request.Form ("txturl")
note=Request.Form ("txtnote")
if len(name)<1 then
Response.Write "Inserite il nome"
Response.End
end if
if len(note)<1 then
Response.Write "Inserite il Commento"
Response.End
end if
if trim(url)="http://" then url=""
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
Conn.ConnectionString = "Data Source=" & Path
Conn.Open
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open "SELECT * from guest", Conn, 1,3
rs.AddNew
rs("name")=name
rs("email")=email
rs("url")=url
rs("note")=note
rs.Update
Rs.Close
Conn.Close
set rs=nothing
set conn=nothing
Response.Redirect "view.asp"
%>
file include.asp
codice:
<%
'This script holds the necessary information such as path of the database, images, etc.
'Path of the database
Path=server.mappath("/mdb-database/dbsec/guest.mdb")
'Images used by guest book
'Divider image
const DivImage="divider.jpg"
'Background image
const BackImage="back.jpg"
'Logo/Banner image
const LogoImage="logo.jpg"
'If you dont want to use the image, assign the variable with empty string
'e.g
'BackImage="" if u dont want to use the background image
'For View.asp
const RsPage=7 'records per page
%>
file sign.asp
codice:
<%
'--------------------------------
'This is the main script which will
'show all the signed entry
'--------------------------------
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
Conn.ConnectionString = "Data Source=" & Path
Conn.Open
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open "SELECT * from guest", Conn, 1,3
if not len(trim(LogoImage))>0 then logo="" else logo="[img]" & LogoImage & "[/img]"
if not len(trim(BackImage))>0 then back="" else back="background='" & BackImage & "'"
Rs.Close
Conn.Close
set Rs=nothing
set Conn=nothing
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>- .:: Benvenuti nel sito web del PREMIO OLMO ::.</title>
<meta http-equiv="Content-Language" content="it">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div align="center">
<center>
<table class="tabella1" cellspacing="0" cellpadding="0" style="background-color: #FFFFAE">
<tr>
<td class="logo" colspan="3">
[img]images/banner.jpg[/img]</td>
</tr>
<tr>
<td class="tbx">
</td>
<td class="tbx1">
<p align="right">:: <a href="../index.htm">
Home </a> </td>
<td class="tbx2">:: Contatti</td>
</tr>
<tr>
<td valign="top" class="main">
<table class="tabella2" cellspacing="0" cellpadding="0">
<tr>
<td class="menu"> :: la Fondazione</td>
</tr>
<tr>
<td class="menu">:: Antonio De Sisto</td>
</tr>
<tr>
<td class="menu">:: Premio Olmo</td>
</tr>
<tr>
<td class="menu">:: La Manifestazione</td>
</tr>
<tr>
<td class="menu">:: Vincitori</td>
</tr>
<tr>
<td class="menu">:: Dicono di noi...</td>
</tr>
<tr>
<td class="menu">:: Dove siamo</td>
</tr>
<tr>
<td class="menu">:: <a href="../comunicatistampa.htm">
Comunicazioni</a></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td>
<p align="center">
[img]images/raviscanina-logo.gif[/img]</td>
</tr>
<tr>
<td>
<p align="center">
</td>
</tr>
<tr>
<td>
<p align="center">
<a href="http://validator.w3.org/check?uri=http://www.premioolmo.it/gb/sign.asp">
[img]images/valid-html401.gif[/img]</a></td>
</tr>
<tr>
<td>
<p align="center">
</td>
</tr>
<tr>
<td>
<p align="center">
<a href="http://jigsaw.w3.org/css-validator/validator?uri=http://www.premioolmo.it/gb/sign.asp">
[img]images/vcss.gif[/img]</a></td>
</tr>
</table>
</td>
<td valign="top" class="main1" style="background-color: #FFFFAE">
<table class="tabella3" cellspacing="0" cellpadding="0">
<tr>
<td>
<p align="center">Lasciate un messaggio nel nostro guestbook</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
<form method="POST" action="add.asp">
<p align="center"></p>
<div align="center">
<center>
<table border="0" width="428" bgcolor="#ECD0AA" style="border-style: ridge" cellspacing="1">
<tr>
<td width="17%" nowrap><font size="1">Nome</font></td>
<td width="81%"><font size="1" face="Verdana,Arial,sans-serif">
<input type="text" name="txtname" size="47"></font></td>
</tr>
<tr>
<td width="17%" nowrap><font size="1">Email </font> </td>
<td width="81%"><font size="1" face="Verdana,Arial,sans-serif">
<input type="text" name="txtemail" size="47"></font></td>
</tr>
<tr>
<td width="17%" nowrap><font size="1">URL</font></td>
<td width="81%"><font face="Verdana" size="1">
<input type="text" name="txturl" size="47" value="http://"></font></td>
</tr>
<tr>
<td width="17%" nowrap valign="top"><font size="1">Commento</font></td>
<td width="81%">
<font size="1" face="Verdana,Arial,sans-serif">
<textarea name="txtnote" cols="40" rows="6" wrap="VIRTUAL"></textarea></font></td>
</tr>
</table>
</center>
</div>
<p align="center">
<input type="submit" value="Firma il guestbook" name="B1"><input type="reset" value="Cancella" name="B2"></p>
</form>
</td>
</tr>
<tr>
<td></td>
</tr>
</table>
</td>
<td valign="top" class="main2">
<table class="tabella4" cellspacing="0" cellpadding="0">
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="middle" class="down1">
</td>
<td valign="middle" class="down2">
<p align="center">Copyright © 2005 Fondazione A. De Sisto - Premio Olmo.</td>
<td valign="middle" class="down">
:: <font color="#000000">Webmaster</font></td>
</tr>
</table>
</center>
</div>
</body>
</html>
file CAPTCHA_form_inc.asp
codice:
<script language="javaScript">
function reloadCAPTCHA() {
document.getElementById('CAPTCHA').src='CAPTCHA_image.asp?'+Date();
}
</script>
<table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td>[img]CAPTCHA_image.asp[/img]<% = strTxtLoadNewCode %></td>
</tr>
<tr>
<td><input type="text" name="securityCode" id="securityCode" size="12" maxlength="12" autocomplete="off" /></td>
</tr><%
If blnCAPTCHAabout Then
Response.Write("<tr><td><span style=""font-size: 10px; font-family: Arial, Helvetica, sans-serif;"">Powered by Web Wiz CAPTCHA version " & strCAPTCHAversion & "
Copyright ©2006 Web Wiz Guide</span></td></tr>")
End If
%>
</table>
File CAPTCHA_setup.asp
codice:
'Initialise variables
Dim blnCAPTCHAabout
'***** Change this if to false if you do NOT want the CAPTCHA code to be case sensitive *****
Const blnCAPTCHAcaseSensitive = true
'***** Change this if tyou wish to chnage the reload image text *****
Const strTxtLoadNewCode = "Load New Code"
'***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
Const strCAPTCHAversion = "2.01"
blnCAPTCHAabout = blnLCode
'***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
%>