<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Aiuto con applicazione CAPTCHA]]></title><description><![CDATA[<p dir="auto">Ciao ragazzi,</p>
<p dir="auto">mi serve una mano con l'applicazione di un captcha con un php script per top 100!</p>
<p dir="auto">Allora comincio dallo script della Top 100:</p>
<p dir="auto">la top 100 contiene varie pagine fatte ovviamente in php, tra le quali ci sono il file per installare la top 100 nel database mysql, il file config.php, la pagina per fare iscrivere i siti e altre!</p>
<p dir="auto">Di seguito vi posto il contenuto della pagina che permette ai siti di iscriversi (join.php)</p>
<pre><code class="language-php">&lt;?
// Report all script errors on this page
error_reporting(E_ALL);
// Including CONFIG.PHP which includes all configurations
require("config.php");
// Including language file
include("languages/" . $lang_file);
?&gt;
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;title&gt;&lt;? echo htmlspecialchars($topsite_name) ."&amp;nbsp;&amp;nbsp;( " .  $text['107'] ." : ". mysql_result(mysql_query("SELECT COUNT(1) FROM ". $table ."_sites"),0) . " )"; ?&gt;&lt;/title&gt;
&lt;link rel="stylesheet" type="text/css" href="http://vincenzothebest.altervista.org/Top100/Skintop-nera.css" /&gt;
 
&lt;script language=javascript&gt;
function showimage()
{
 if(!document.images)return;
 document.images.icons.src="http://www.giorgiotave.it/forum/images/flags/"+document.form.country.options[document.form.country.selectedIndex].value;
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body id="container"&gt;
 &lt;div id="header"&gt;
 
  &lt;table width="100%" border="0" cellpadding="0" cellspacing="0"&gt;
   &lt;tr&gt;
    &lt;td align="center"&gt;
    &lt;div id="headerlogo"&gt;&lt;/div&gt;
     &lt;/td&gt;
   &lt;/tr&gt;
  &lt;/table&gt;    
 
 &lt;/div&gt; 
 
&lt;?
// Check if the installation file still is located in the topsites directory
if(file_exists("install.php"))
{ // If it is... give error
?&gt;
&lt;table cellpadding="2" cellspacing="0" width="75%" align="center"&gt;
  &lt;tr&gt;
    &lt;td colspan="2"&gt;&lt;br&gt;&lt;hr /&gt;&lt;br&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;table border="1" cellpadding="2" cellspacing="0" width="50%" class="content" align="center"&gt;
  &lt;tr class="title"&gt;
    &lt;td width="100%" align="center"&gt;&lt;? echo $text['1'] ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="100%"&gt;&lt;? echo $text['9'] ?&gt; ...&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;?
}
else
{ // Else start executing the script
?&gt;
 
&lt;center&gt;
&lt;div align="center" style="padding:3px;width:75%;"&gt;
&lt;ul id="maintab" class="basictab"&gt;
&lt;li&gt;&lt;a href="index.php"&gt;&lt;? echo $text['2'] ?&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li rel="references"&gt;&lt;a href="#"&gt;Aggiungi il tuo sito &amp;#9660;&lt;/a&gt;&lt;/li&gt;
&lt;li rel="references2"&gt;&lt;a href="#"&gt;Recupera i tuoi dati &amp;#9660;&lt;/a&gt;&lt;/li&gt;
&lt;li rel="references3"&gt;&lt;a href="#"&gt;Gestisci i tuoi dati &amp;#9660;&lt;/a&gt;&lt;/li&gt;
&lt;li rel="references4"&gt;&lt;a href="#"&gt;Utilità per il tuo sito &amp;#9660;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div id="references" class="submenustyle"&gt;
&lt;a href="&lt;? echo $_SERVER['PHP_SELF'] ?&gt;"&gt;&lt;? echo $text['3'] ?&gt;&lt;/a&gt;
&lt;a href="http://vincenzothebest.altervista.org/Top100/faq.html"&gt;F.A.Q.&lt;/a&gt;
&lt;a href="http://vincenzothebest.altervista.org/Top100/regolamento.html"&gt;Regolamento&lt;/a&gt;
&lt;/div&gt;
 
&lt;div id="references2" class="submenustyle"&gt;
&lt;a href="lostid.php"&gt;&lt;? echo $text['5'] ?&gt;&lt;/a&gt;
&lt;a href="lostcode.php"&gt;&lt;? echo $text['6'] ?&gt;&lt;/a&gt;
&lt;a href="passreset.php"&gt;&lt;? echo $text['7'] ?&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div id="references3" class="submenustyle"&gt;
&lt;a href="edit.php"&gt;&lt;? echo $text['4'] ?&gt;&lt;/a&gt;
&lt;a href="admin.php"&gt;&lt;? echo $text['8'] ?&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div id="references4" class="submenustyle"&gt;
&lt;a href="http://vincenzothebest.altervista.org/Top100/manuale_banner.html"&gt;Manuale: Come creare un banner&lt;/a&gt;
&lt;/div&gt;
&lt;script type="text/javascript"&gt;
//initialize tab menu, by passing in ID of UL
initalizetab("maintab")
&lt;/script&gt;
&lt;div id="references" class="submenustyle"&gt;
&lt;a href="&lt;? echo $_SERVER['PHP_SELF'] ?&gt;"&gt;&lt;font class="active"&gt;&lt;? echo $text['3'] ?&gt;&lt;/font&gt;&lt;/a&gt;
&lt;a href="http://vincenzothebest.altervista.org/Top100/faq.html"&gt;F.A.Q.&lt;/a&gt;
&lt;a href="http://vincenzothebest.altervista.org/Top100/regolamento.html"&gt;Regolamento&lt;/a&gt;
&lt;/div&gt;
 
&lt;div id="references2" class="submenustyle"&gt;
&lt;a href="lostid.php"&gt;&lt;? echo $text['5'] ?&gt;&lt;/a&gt;
&lt;a href="lostcode.php"&gt;&lt;? echo $text['6'] ?&gt;&lt;/a&gt;
&lt;a href="passreset.php"&gt;&lt;? echo $text['7'] ?&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div id="references3" class="submenustyle"&gt;
&lt;a href="edit.php"&gt;&lt;? echo $text['4'] ?&gt;&lt;/a&gt;
&lt;a href="admin.php"&gt;&lt;? echo $text['8'] ?&gt;&lt;/a&gt;
&lt;/div&gt;
 
&lt;div id="references4" class="submenustyle"&gt;
&lt;a href="http://vincenzothebest.altervista.org/Top100/manuale_banner.html"&gt;Manuale: Come creare un banner&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/center&gt;
 
&lt;?
 // Show form to add your site
 if(!isset($_POST['submit']))
 {
?&gt;
&lt;center&gt;
 &lt;table style="margin-top: 30px;" border="1" cellpadding="2" cellspacing="0" width="50%" class="content" align="center"&gt;
   &lt;tr class="title"&gt;
  &lt;form method="POST" name=form&gt;
  &lt;input type="hidden" name="submit" value="1"&gt;
  &lt;td width="100%" colspan="2"&gt;
  &lt;p align="center"&gt;&lt;? echo $text['73'] ?&gt;&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
  &lt;td width="50%"&gt;&lt;? echo $text['36'] ?&gt; :&lt;/td&gt;
  &lt;td width="50%"&gt;&lt;input type="text" name="sitename" size="24" maxlength="50"&gt;&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
  &lt;td width="50%"&gt;&lt;? echo $text['37'] ?&gt; :&lt;/td&gt;
  &lt;td width="50%"&gt;&lt;input type="text" name="url" size="24" maxlength="100"&gt;&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
  &lt;td width="50%"&gt;&lt;? echo $text['38'] ?&gt; [ 88 x 31 ] :&lt;/td&gt;
  &lt;td width="50%"&gt;&lt;input type="text" name="buttonurl" size="24" maxlength="125"&gt;&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
  &lt;td width="50%"&gt;&lt;? echo $text['39'] ?&gt; :&lt;/td&gt;
  &lt;td width="50%"&gt;&lt;input type="text" name="email" size="24" maxlength="75"&gt;&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
  &lt;td width="50%"&gt;&lt;? echo $text['137'] ?&gt; :&lt;/td&gt;
  &lt;td width="50%"&gt;&lt;select name="country" onChange="showimage()"&gt;&lt;?
 
   // Selecting different flags directory 'images/flags'
   $handle = opendir('images/flags');
   while(false!==($file = readdir($handle)))
   {
    if($file != "." AND $file != "..")
    {
     if($file == "flag_oth.gif")
     {
      $selected = " selected";
     }
     else
     {
      $selected = " ";
     }
 
     echo "&lt;option value=\"" . $file . "\"" . $selected . "&gt;" . $file . "&lt;/option&gt;\n";
    }
   }
 
   closedir($handle);
 ?&gt;
  &lt;/select&gt;&lt;img src="http://www.giorgiotave.it/forum/images/flags/flag_oth.gif" name="icons" border="1" hspace="10"&gt;&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
  &lt;td width="50%" valign="top"&gt;&lt;? echo $text['40'] ?&gt; :&lt;/td&gt;
  &lt;td width="50%"&gt;&lt;textarea rows="7" name="description" cols="26"&gt;&lt;/textarea&gt;&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
  &lt;td width="50%" valign="top"&gt;&lt;? echo $text['22'] ?&gt; :&lt;/td&gt;
  &lt;td width="50%"&gt;&lt;input type="password" name="pssw" size="12" maxlength="25"&gt;&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
  &lt;td width="50%" valign="top"&gt;&lt;? echo $text['22'] ?&gt; [ &lt;? echo $text['59'] ?&gt; ]:&lt;/td&gt;
  &lt;td width="50%"&gt;&lt;input type="password" name="pssw2" size="12" maxlength="25"&gt;&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
  &lt;td width="100%" valign="top" colspan="2"&gt;
  &lt;p align="center"&gt;&lt;input type="submit" value="&lt;? echo $text['72'] ?&gt;"&gt;&lt;/td&gt;
   &lt;/tr&gt; 
 &lt;/table&gt;
 
&lt;/center&gt; 
&lt;?
 }
 // Form has been submitted
 if(isset($_POST['submit']))
 {
  // Checking if email isn't used before to register a website
  $query = mysql_query("SELECT COUNT(1) FROM " . $table . "_sites WHERE email = '" . $_POST['email'] . "'");
  $result = mysql_result($query,0);
  // If email has been registered, give error
  if(!empty($result))
  {
?&gt;
&lt;table border="1" cellpadding="2" cellspacing="0" width="50%" class="content" align="center"&gt;
  &lt;tr class="title"&gt;
    &lt;td width="100%"&gt;&lt;p align="center"&gt;&lt;? echo $text['73'] ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="100%"&gt;&lt;? echo $text['74'] ?&gt; ...
    &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;?
  }
  else
  { // If email hasn't been registered, run script to add site
?&gt;
&lt;table border="1" cellpadding="2" cellspacing="0" width="50%" align="center"&gt;
  &lt;tr class="title"&gt;
    &lt;td width="100%"&gt;&lt;p align="center"&gt;&lt;? echo $text['73'] ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr class="content"&gt;
    &lt;td width="100%"&gt;
&lt;?
   // If sitename wasn't filled in
   if(empty($_POST['sitename']))
   {
?&gt;
      &lt;? echo $text['75'] ?&gt;
      &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;
&lt;?
   }
   // If URL wasn't filled in
   elseif(empty($_POST['url']))
   {
?&gt;
      &lt;? echo $text['76'] ?&gt;
      &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;";
&lt;?
   }
   // If email wasn't filled in
   elseif(empty($_POST['email']))
   {
?&gt;
      &lt;? echo $text['77'] ?&gt;
      &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;
&lt;?
   }
   // If description wasn't filled in
   elseif(empty($_POST['description']))
   {
?&gt;
      &lt;? echo $text['78'] ?&gt;
      &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;
&lt;?
   }
   // If password / confirm password weren't filled in
   elseif(empty($_POST['pssw']) OR empty($_POST['pssw2']))
   {
?&gt;
      &lt;? echo $text['79'] ?&gt;
      &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;
&lt;?
   }
   else
   {
    // If passwords are not the same 
    if($_POST['pssw'] != $_POST['pssw2'] OR empty($_POST['pssw']) OR empty($_POST['pssw2']))
    {
?&gt;
      &lt;? echo $text['61'] ?&gt; ...
      &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;
&lt;?
    }
    else
    {
     // Not encrypted version of password
     $pssw = $_POST['pssw'];
     // Encrypted version of password
     $pssw_encrypted = md5($_POST['pssw']);
     $_POST['country'] = str_replace("flag_","", $_POST['country']);
     $_POST['country'] = str_replace(".gif","", $_POST['country']);
     $date = date("dmY");
 
     // Insert data of website into database
     mysql_query("INSERT INTO " . $table . "_sites (sitename,url,buttonurl,email,description,password,hitsin,clicksin,hitsout,hitstotal,hitstoday,date,register_date,country,rank,ip) VALUES ('" . $_POST['sitename'] . "','" . $_POST['url'] . "','" . $_POST['buttonurl'] . "','" . $_POST['email'] . "','" . $_POST['description'] . "','" . $pssw_encrypted . "','0','0','0','0','" . $date . " | 0','" . $date . " | 1',NOW(),'" . $_POST['country'] . "','-','" . $_SERVER['REMOTE_ADDR'] . "')") or die (mysql_error());
     $query = mysql_query("SELECT * FROM " . $table . "_sites WHERE email = '" . $_POST['email'] . "' AND url = '" . $_POST['url'] . "'") or die(mysql_error());
     while($row = mysql_fetch_assoc($query))
     {
      $memberid = $row['memberid'];
     }
     // Creating row for ratings for this website
     mysql_query("INSERT INTO " . $table . "_rate VALUES ('$memberid','0','0')") or die (mysql_error());
     $sitename = htmlspecialchars($_POST['sitename']);
     $email = htmlspecialchars($_POST['email']);
     $url = htmlspecialchars($_POST['url']);
     $buttonurl = htmlspecialchars($_POST['buttonurl']);
     $description = htmlspecialchars($_POST['description']);
     $message = "&lt;font style=\"font-family: verdana; font-size: 8pt\"&gt;
 
     Hai fatto richiesta alla top100: " . $webmaster_url . ",&lt;br&gt;
     Ecco perchè vi inviamo il riepilogo dei vostri dati. La preghiamo di conservare questa e-mail. La password sottostante è decriptata ma nei nostri server è criptata per proteggervi da hacker.!&lt;br&gt;&lt;br&gt;
 
     INFORMAZIONI ACCOUNT " . $memberid . "&lt;br&gt;
     ID: " . $memberid . "&lt;br&gt;
     Nome Sito : " . $sitename . "&lt;br&gt;
     URL : " . $url . "&lt;br&gt;
     Button URL : " . $buttonurl . "&lt;br&gt;
     Descrizione : " . $description . "&lt;br&gt;
     Password : " . $pssw . "&lt;br&gt;
     &lt;br&gt;&lt;br&gt;Grazie,&lt;br&gt;
     Webmaster di " . $webmaster_url . "&lt;/font&gt;";
 
     mail("$email","Ti Sei Iscritto a: " . $topsite_name . " !!!","$message","From: Ti Sei Iscritto a: " . $topsite_name . " !!!&lt;" . $webmaster_email . "&gt;\nContent-Type: text/html; charset=iso-8859-1");
 
     if($webmaster_sendmail)
     {
      $message = "&lt;font style=\"font-family: verdana; font-size: 8pt\"&gt;
 
     Un nuovo membro si è iscritto alla tua top100, ecco i suoi dati:&lt;br&gt;&lt;br&gt;INFORMAZIONI ACCOUNT " . $memberid . "&lt;br&gt;
     ID: " . $memberid . "&lt;br&gt;
     Nome Sito : " . $sitename . "&lt;br&gt;
     URL : " . $url . "&lt;br&gt;
     Button URL : " . $buttonurl . "&lt;br&gt;
     Descrizione : " . $description . "&lt;br&gt;
     Password : " . $pssw . "&lt;br&gt;
     &lt;br&gt;&lt;br&gt;Grazie,&lt;br&gt;
     Webmaster di " . $webmaster_url . "&lt;/font&gt;";
      mail("$webmaster_email","Nuovo Membro Nella TOP100", "$message","From: Nuovo Membro Nella TOP100&lt;" . $webmaster_email . "&gt;\nContent-Type: text/html; charset=iso-8859-1");
     }
?&gt;
      &lt;? echo $text['80'] ?&gt;&lt;br&gt;&lt;br&gt;
      &lt;? echo $text['81'] ?&gt;:&lt;br&gt;&lt;br&gt;&lt;center&gt;
      &lt;textarea cols="45" rows="5" onClick="this.select()"&gt;&lt;a href="&lt;? echo $script_url ?&gt;/index.php?id=&lt;? echo $memberid ?&gt;" target="_blank"&gt;&lt;img src="&lt;? echo $script_url ?&gt;/img.php?id=&lt;? echo $memberid ?&gt;" border="0"&gt;&lt;/a&gt;&lt;/textarea&gt;&lt;br&gt;
      &lt;a href="index.php"&gt;&lt;&lt; &lt;? echo $text['82'] ?&gt;&lt;/a&gt;&lt;/center&gt;
&lt;?
    }
   }
?&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;?
  }
 }
}
?&gt;
&lt;table cellpadding="0" cellspacing="0" width="75%" align="center"&gt;
  &lt;tr&gt;
    &lt;td width="100%"&gt;&lt;br&gt;&lt;hr /&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;?
$time = $debug-&gt;endTimer();
echo "&lt;center&gt;";
 
echo "\n&lt;br&gt;Pagina caricata in : " . $time . " secondi.";
echo "&lt;/center&gt;";
include("footer.txt");
 
&lt;/body&gt;
&lt;/html&gt;
?&gt;
</code></pre>
<p dir="auto">In questa pagina voglio integrare lo script del CAPTCHA ma non so proprio come fare!</p>
<p dir="auto">Il Captcha richiede la creazione di una tabella nel database<br />
ed è la seguente:</p>
<pre><code class="language-php">CREATE TABLE validation (
   id INT UNSIGNED NOT NULL AUTO_INCREMENT,
   url_key CHAR(40) UNIQUE NOT NULL,
   captcha CHAR(32) NOT NULL,
   expire_date DATETIME NOT NULL,
 
   PRIMARY KEY(id),
   INDEX(url_key)
);
</code></pre>
<p dir="auto">poi lo script presenta due parti:</p>
<ol>
<li>questa parte permette il funzionamento dello script:</li>
</ol>
<pre><code class="language-php">&lt;?php
 
$pdo = new PDO('mysql:host=localhost;dbname=captcha', 'root', '');
 
$stmt = $pdo-&gt;prepare("SELECT * FROM validation WHERE url_key = ? AND expire_date &gt; NOW()");
$stmt-&gt;execute(array($_GET['token']));
 
$row = $stmt-&gt;fetch(PDO::FETCH_ASSOC);
 
$texture = imagecreatefrompng('texture.png');
 
$source = imagecolorat($texture, rand(0, imagesx($texture)), rand(0, imagesy($texture)));
$r = ($source &gt;&gt; 16 &amp; 0xff) + 50;
$g = ($source &gt;&gt; 8 &amp; 0xff) + 50;
$b = ($source &amp; 0xff) + 50;
$text_color = imagecolorallocate($texture, $r, $g, $b);
 
imagestring($texture, 5, (imagesx($texture) - strlen($row['captcha']) * 5)/ 2, 5,  $row['captcha'], $text_color);
 
header('Content-Type: image/png');
 
imagepng($texture);
 
imagedestroy($texture);
 
?&gt;
</code></pre>
<ol start="2">
<li>questa invece serve a controllare la corretta immissione dei caratteri da parte di coloro che si vogliono iscrivere:</li>
</ol>
<pre><code class="language-php">&lt;?php
 
function random_string($len)
{
   $string = "";
   $chars = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k",
               "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
               "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G",
               "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R",
               "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2",
               "3", "4", "5", "6", "7", "8", "9");
   for($i = 0; $i &lt; $len; ++$i)
   {
      shuffle($chars);
      $string .= $chars[0];
   }
 
   return $string;
}
 
$message = 'Inserisci la scringa alphanumerica per effettuare la validazione:';
 
$pdo = new PDO('mysql:host=localhost;dbname=captcha', 'root', '');
$pdo-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
 
if(isset($_POST['validate_token']))
{
   // Eseguo la validazione
   $stmt = $pdo-&gt;prepare("SELECT * FROM validation WHERE url_key = ? AND expire_date &gt; NOW()");
   $stmt-&gt;execute(array($_POST['token']));
 
   $row = $stmt-&gt;fetch(PDO::FETCH_ASSOC);
 
   $message = ($row &amp;&amp; ($row['captcha'] == $_POST['validate_token'])) ? 'token corretto' : 'token &lt;strong&gt;NON&lt;/strong&gt; corretto';
   $stmt = $pdo-&gt;prepare("DELETE FROM validation WHERE url_key = ?");
   $stmt-&gt;execute(array($_POST['token']));
}
 
// Elimino tutti i record scaduti
$pdo-&gt;query("DELETE FROM validation WHERE expire_date &lt;= NOW()");
 
// Genero casualmente un record per la tabella validation
$url_key = sha1(uniqid(rand(), true)); // Possiamo (e dovremmo) fare meglio
$captcha = random_string(6);
$stmt = $pdo-&gt;prepare("INSERT INTO validation (id, url_key, captcha, expire_date) VALUES ('', ?, ?, DATE_ADD(NOW(), INTERVAL 5 MINUTE))");
$stmt-&gt;execute(array($url_key, $captcha));
 
?&gt;
&lt;html&gt;
   &lt;head&gt;
      &lt;title&gt;CAPTCHA test&lt;/title&gt;
   &lt;/head&gt;
   &lt;body&gt;
      &lt;form method="POST" action="&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;"&gt;
         &lt;input type="hidden" name="token" value="&lt;?php echo $url_key; ?&gt;" /&gt;
         &lt;p&gt;
            &lt;?php echo $message; ?&gt;
         &lt;/p&gt;
         &lt;img src="captcha.php?token=&lt;?php echo $url_key; ?&gt;" width="200" height="30" /&gt;&lt;br/&gt;
         &lt;input type="text" name="validate_token" /&gt;
         &lt;input type="submit" name="action" value="Test" /&gt;
      &lt;/form&gt;
   &lt;/body&gt;
&lt;/html&gt;
</code></pre>
<p dir="auto">Questo è tutto! La mia difficoltà sta nell'integrare il CAPTCHA allo script della Top 100!</p>
<p dir="auto">C'è qualcuno esperto in php che può aiutarmi?</p>
<p dir="auto">P.s il lavoro e l'aiuto verranno ricambiati assolutamente!</p>
]]></description><link>https://dev.connect.gt/topic/43644/aiuto-con-applicazione-captcha</link><generator>RSS for Node</generator><lastBuildDate>Fri, 27 Nov 2026 14:58:42 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/43644.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 16 Aug 2007 19:52:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Aiuto con applicazione CAPTCHA on Tue, 21 Aug 2007 21:39:26 GMT]]></title><description><![CDATA[<p dir="auto">Si scusa hai ragione! Cmq molto probabilmente non ti funziona la pagina perchè come ti ho spiegato lo script va installato in un database mysql!</p>
<p dir="auto">Cmq l'errore di sintassi si riferiva alle parentesi graffe chiuse in fondo allo script...</p>
]]></description><link>https://dev.connect.gt/post/582488</link><guid isPermaLink="true">https://dev.connect.gt/post/582488</guid><dc:creator><![CDATA[vincenzol]]></dc:creator><pubDate>Tue, 21 Aug 2007 21:39:26 GMT</pubDate></item><item><title><![CDATA[Reply to Aiuto con applicazione CAPTCHA on Tue, 21 Aug 2007 21:11:21 GMT]]></title><description><![CDATA[<p dir="auto">??? ma dico ??? ma il lavoro è tuo? o è mio?<br />
no perchè mi sta venendo un dubbio...</p>
<p dir="auto">comunque il file che mi hai invato non funziona e da errore perchè mancano dei file di inclusione...</p>
<p dir="auto">non puoi mica scaricar il lavoro così se vuoi un aiuto devi anche collaborare</p>
<p dir="auto">io sullo script che mi hai inviato all'inizio ho realizzato un sistema funzionante ora potresti anche provare ad inserirlo tu nel tuo progetto</p>
<p dir="auto">se poi trovi dei problemi come hai fatto prima scirivi e dici che problemi hai trovato e via via si cerca di darti una mano ma per favore collabora!</p>
]]></description><link>https://dev.connect.gt/post/582481</link><guid isPermaLink="true">https://dev.connect.gt/post/582481</guid><dc:creator><![CDATA[gabrielem]]></dc:creator><pubDate>Tue, 21 Aug 2007 21:11:21 GMT</pubDate></item><item><title><![CDATA[Reply to Aiuto con applicazione CAPTCHA on Tue, 21 Aug 2007 21:04:03 GMT]]></title><description><![CDATA[<p dir="auto">Come immaginavo mi da errori di sintassi...come facevi a dire che lo script funziona se non hai visto il resto dello script?</p>
<p dir="auto">Per quel motivo ti ho postato la pagina intera...Spero tu voglia aiutarmi...</p>
]]></description><link>https://dev.connect.gt/post/582487</link><guid isPermaLink="true">https://dev.connect.gt/post/582487</guid><dc:creator><![CDATA[vincenzol]]></dc:creator><pubDate>Tue, 21 Aug 2007 21:04:03 GMT</pubDate></item><item><title><![CDATA[Reply to Aiuto con applicazione CAPTCHA on Tue, 21 Aug 2007 20:46:05 GMT]]></title><description><![CDATA[<p dir="auto">Scusa ma lo script che ti ho inviato è già funzionante...</p>
<p dir="auto">la parte</p>
<pre><code class="language-php">&lt;table border="1" cellpadding="2" cellspacing="0" width="50%" class="content" align="center"&gt;
  &lt;tr class="title"&gt;
    &lt;td width="100%"&gt;&lt;p align="center"&gt;ERRORE....&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="100%"&gt;La risposta non è corretta ...
    &lt;br&gt;&lt;br&gt;&lt;a href="post.php"&gt;&lt;&lt; torna indietro&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
</code></pre>
<p dir="auto">la puoi personalizzare da solo<br />
post.php è il nome della pagina che ho usato io per la prova li puoi mettere quelo che vuoi</p>
<p dir="auto">per il resto lo script funziona...</p>
]]></description><link>https://dev.connect.gt/post/582474</link><guid isPermaLink="true">https://dev.connect.gt/post/582474</guid><dc:creator><![CDATA[gabrielem]]></dc:creator><pubDate>Tue, 21 Aug 2007 20:46:05 GMT</pubDate></item><item><title><![CDATA[Reply to Aiuto con applicazione CAPTCHA on Tue, 21 Aug 2007 20:18:17 GMT]]></title><description><![CDATA[<p dir="auto">Non ho capito in questa parte</p>
<pre><code class="language-php">&lt;table border="1" cellpadding="2" cellspacing="0" width="50%" class="content" align="center"&gt;
  &lt;tr class="title"&gt;
    &lt;td width="100%"&gt;&lt;p align="center"&gt;ERRORE....&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="100%"&gt;La risposta non è corretta ...
    &lt;br&gt;&lt;br&gt;&lt;a href="post.php"&gt;&lt;&lt; torna indietro&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
</code></pre>
<p dir="auto">perchè fai riferimento a post.php?</p>
<p dir="auto">Cmq ti ho allegato il file intero dello script cosi ne capisci per intero la sua logica...;)</p>
<p dir="auto">NB: puntualizzo che la pagina che ti ho allegato contiene un form che permette alla gente di iscriversi ad una classifica! Questo file fa riferimento anche ad un file di installazione, che ha creato le tabelle nel mio db mysql)</p>
]]></description><link>https://dev.connect.gt/post/582486</link><guid isPermaLink="true">https://dev.connect.gt/post/582486</guid><dc:creator><![CDATA[vincenzol]]></dc:creator><pubDate>Tue, 21 Aug 2007 20:18:17 GMT</pubDate></item><item><title><![CDATA[Reply to Aiuto con applicazione CAPTCHA on Tue, 21 Aug 2007 19:48:06 GMT]]></title><description><![CDATA[<pre><code class="language-php">&lt;?
// Show form to add your site

//ATTENZIONE PER OGNI DOMANDA INSERIRE UNA RISPOSTA
$aDOMANDE=array('Quanto fa 10+3?', 'quale lettera è la iniziale di &lt;b&gt;BIANCO&lt;/b&gt;?', 'scrivi solo la parola &lt;b&gt;ROMA&lt;/b&gt;');
$aRISPOSTE=array('13', 'B', 'Roma');

$TOTALE_domande=count($aDOMANDE); $TOTALE_domande=$TOTALE_domande-1;
//for ($iQ = 0; $iQ &lt; count($righeCheck); $iQ++) { 


if(!isset($_POST['submit']))
{
?&gt;
&lt;table style="margin-top: 30px;" border="1" cellpadding="2" cellspacing="0" width="50%" class="content" align="center"&gt;
  &lt;tr class="title"&gt;
    &lt;form method="POST" name=form&gt;
    &lt;input type="hidden" name="submit" value="1"&gt;
    &lt;td width="100%" colspan="2"&gt;
    &lt;p align="center"&gt;&lt;? echo $text['73'] ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="50%"&gt;&lt;? echo $text['36'] ?&gt; :&lt;/td&gt;
    &lt;td width="50%"&gt;&lt;input type="text" name="sitename" size="24" maxlength="50"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="50%"&gt;&lt;? echo $text['37'] ?&gt; :&lt;/td&gt;
    &lt;td width="50%"&gt;&lt;input type="text" name="url" size="24" maxlength="100"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="50%"&gt;&lt;? echo $text['38'] ?&gt; [ 88 x 31 ] :&lt;/td&gt;
    &lt;td width="50%"&gt;&lt;input type="text" name="buttonurl" size="24" maxlength="125"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="50%"&gt;&lt;? echo $text['39'] ?&gt; :&lt;/td&gt;
    &lt;td width="50%"&gt;&lt;input type="text" name="email" size="24" maxlength="75"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="50%"&gt;&lt;? echo $text['137'] ?&gt; :&lt;/td&gt;
    &lt;td width="50%"&gt;&lt;select name="country" onChange="showimage()"&gt;&lt;?
  // Selecting different flags directory 'images/flags'
  $handle = opendir('images/flags');
  while(false!==($file = readdir($handle)))
  {
   if($file != "." AND $file != "..")
   {
    if($file == "flag_oth.gif")
    {
     $selected = " selected";
    }
    else
    {
     $selected = " ";
    }
    echo "&lt;option value=\"" . $file . "\"" . $selected . "&gt;" . $file . "&lt;/option&gt;\n";
   }
  }
  closedir($handle);
?&gt;
    &lt;/select&gt;&lt;img src="images/flags/flag_oth.gif" name="icons" border="1" hspace="10"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="50%" valign="top"&gt;&lt;? echo $text['40'] ?&gt; :&lt;/td&gt;
    &lt;td width="50%"&gt;&lt;textarea rows="7" name="description" cols="26"&gt;&lt;/textarea&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="50%" valign="top"&gt;&lt;? echo $text['22'] ?&gt; :&lt;/td&gt;
    &lt;td width="50%"&gt;&lt;input type="password" name="pssw" size="12" maxlength="25"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="50%" valign="top"&gt;&lt;? echo $text['22'] ?&gt; [ &lt;? echo $text['59'] ?&gt; ]:&lt;/td&gt;
    &lt;td width="50%"&gt;&lt;input type="password" name="pssw2" size="12" maxlength="25"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="100%" valign="top" colspan="2"&gt;
   Sei umano?&lt;br&gt;
   &lt;?
    $idDomanda=rand(0,$TOTALE_domande);
    echo $aDOMANDE[$idDomanda];
   ?&gt;
   &lt;input type="text" name="risposta" size="40" maxlength="100"&gt;
   &lt;input type="Hidden" name="idDomanda" value="&lt;? echo $idDomanda; ?&gt;"&gt;
  
    &lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
    &lt;td width="100%" valign="top" colspan="2"&gt;
    &lt;p align="center"&gt;&lt;input type="submit" value="&lt;? echo $text['72'] ?&gt;"&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;?
}
// Form has been submitted
if(isset($_POST['submit']) and isset($_POST['sitename']) and isset($_POST['url']))
//con [ and isset($_POST['nomeCAMPO']) ] aggiungi i campi che devono essere riempiti per l'invio del form
{

//CONDIZIONE DI CONTROLLO DELLA PAGINA RANDOM uso strtolower() per evitare problemi di scrittura tar minuscolo e maiuscolo strtolower() trasforma tutto in minuscolo
if( strtolower($aRISPOSTE[$idDomanda]) != strtolower($_POST['risposta']) ) {
//stampo l'errore magari quello lo peronalizzi (non ho capito la logica...)

echo strtolower($aRISPOSTE[$idDomanda])."&lt;br&gt;";
echo strtolower($_POST['risposta'])."&lt;br&gt;";
?&gt;

&lt;table border="1" cellpadding="2" cellspacing="0" width="50%" class="content" align="center"&gt;
  &lt;tr class="title"&gt;
    &lt;td width="100%"&gt;&lt;p align="center"&gt;ERRORE....&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="100%"&gt;La risposta non è corretta ...
    &lt;br&gt;&lt;br&gt;&lt;a href="post.php"&gt;&lt;&lt; torna indietro&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;?
} else { 


  // Checking if email isn't used before to register a website
  $query = mysql_query("SELECT COUNT(1) FROM " . $table . "_sites WHERE email = '" . $_POST['email'] . "'");
  $result = mysql_result($query,0);
  // If email has been registered, give error
  if(!empty($result))
  {
?&gt;
&lt;table border="1" cellpadding="2" cellspacing="0" width="50%" class="content" align="center"&gt;
  &lt;tr class="title"&gt;
    &lt;td width="100%"&gt;&lt;p align="center"&gt;&lt;? echo $text['73'] ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="100%"&gt;&lt;? echo $text['74'] ?&gt; ...
    &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;?
  }
  else
  { // If email hasn't been registered, run script to add site
?&gt;
&lt;table border="1" cellpadding="2" cellspacing="0" width="50%" align="center"&gt;
  &lt;tr class="title"&gt;
    &lt;td width="100%"&gt;&lt;p align="center"&gt;&lt;? echo $text['73'] ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr class="content"&gt;
    &lt;td width="100%"&gt;
&lt;?
   // If sitename wasn't filled in
   if(empty($_POST['sitename']))
   {
?&gt;
      &lt;? echo $text['75'] ?&gt;
      &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;
&lt;?
   }
   // If URL wasn't filled in
   elseif(empty($_POST['url']))
   {
?&gt;
      &lt;? echo $text['76'] ?&gt;
      &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;";
&lt;?
   }
   // If email wasn't filled in
   elseif(empty($_POST['email']))
   {
?&gt;
      &lt;? echo $text['77'] ?&gt;
      &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;
&lt;?
   }
   // If description wasn't filled in
   elseif(empty($_POST['description']))
   {
?&gt;
      &lt;? echo $text['78'] ?&gt;
      &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;
&lt;?
   }
   // If password / confirm password weren't filled in
   elseif(empty($_POST['pssw']) OR empty($_POST['pssw2']))
   {
?&gt;
      &lt;? echo $text['79'] ?&gt;
      &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;
&lt;?
   }
   else
   {
    // If passwords are not the same
    if($_POST['pssw'] != $_POST['pssw2'] OR empty($_POST['pssw']) OR empty($_POST['pssw2']))
    {
?&gt;
      &lt;? echo $text['61'] ?&gt; ...
      &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;
&lt;?
    }
    else
    {
     // Not encrypted version of password
     $pssw = $_POST['pssw'];
     // Encrypted version of password
     $pssw_encrypted = md5($_POST['pssw']);
     $_POST['country'] = str_replace("flag_","", $_POST['country']);
     $_POST['country'] = str_replace(".gif","", $_POST['country']);
     $date = date("dmY"); 
     }
     }
     }
}
}
     ?&gt;
</code></pre>
]]></description><link>https://dev.connect.gt/post/582475</link><guid isPermaLink="true">https://dev.connect.gt/post/582475</guid><dc:creator><![CDATA[gabrielem]]></dc:creator><pubDate>Tue, 21 Aug 2007 19:48:06 GMT</pubDate></item><item><title><![CDATA[Reply to Aiuto con applicazione CAPTCHA on Tue, 21 Aug 2007 19:25:12 GMT]]></title><description><![CDATA[<p dir="auto">lo script che hai postato non è completo manca qualcosa<br />
è troncato sul fondo...<br />
comunque ora gli do un'occhiata</p>
]]></description><link>https://dev.connect.gt/post/582483</link><guid isPermaLink="true">https://dev.connect.gt/post/582483</guid><dc:creator><![CDATA[gabrielem]]></dc:creator><pubDate>Tue, 21 Aug 2007 19:25:12 GMT</pubDate></item><item><title><![CDATA[Reply to Aiuto con applicazione CAPTCHA on Tue, 21 Aug 2007 18:48:29 GMT]]></title><description><![CDATA[<p dir="auto">Allora ti preavviso  che è un modulo che non fa riferimento ad un'altra pagina a parte in php, ma la sua azione è $_POST</p>
<p dir="auto">Ho cercato di fissare la condizione che se il campo rimane vuoto il modulo non deve essere eseguito, però il modulo anche in presenza di campi vuoti viene eseguito comunque!</p>
<p dir="auto">Di seguito ho postato il codice dello script:</p>
<pre><code class="language-php">&lt;?
 // Show form to add your site
 if(!isset($_POST['submit']))
 {
?&gt;
&lt;table style="margin-top: 30px;" border="1" cellpadding="2" cellspacing="0" width="50%" class="content" align="center"&gt;
  &lt;tr class="title"&gt;
    &lt;form method="POST" name=form&gt;
    &lt;input type="hidden" name="submit" value="1"&gt;
    &lt;td width="100%" colspan="2"&gt;
    &lt;p align="center"&gt;&lt;? echo $text['73'] ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="50%"&gt;&lt;? echo $text['36'] ?&gt; :&lt;/td&gt;
    &lt;td width="50%"&gt;&lt;input type="text" name="sitename" size="24" maxlength="50"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="50%"&gt;&lt;? echo $text['37'] ?&gt; :&lt;/td&gt;
    &lt;td width="50%"&gt;&lt;input type="text" name="url" size="24" maxlength="100"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="50%"&gt;&lt;? echo $text['38'] ?&gt; [ 88 x 31 ] :&lt;/td&gt;
    &lt;td width="50%"&gt;&lt;input type="text" name="buttonurl" size="24" maxlength="125"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="50%"&gt;&lt;? echo $text['39'] ?&gt; :&lt;/td&gt;
    &lt;td width="50%"&gt;&lt;input type="text" name="email" size="24" maxlength="75"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="50%"&gt;&lt;? echo $text['137'] ?&gt; :&lt;/td&gt;
    &lt;td width="50%"&gt;&lt;select name="country" onChange="showimage()"&gt;&lt;?
  // Selecting different flags directory 'images/flags'
  $handle = opendir('images/flags');
  while(false!==($file = readdir($handle)))
  {
   if($file != "." AND $file != "..")
   {
    if($file == "flag_oth.gif")
    {
     $selected = " selected";
    }
    else
    {
     $selected = " ";
    }
    echo "&lt;option value=\"" . $file . "\"" . $selected . "&gt;" . $file . "&lt;/option&gt;\n";
   }
  }
  closedir($handle);
?&gt;
    &lt;/select&gt;&lt;img src="images/flags/flag_oth.gif" name="icons" border="1" hspace="10"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="50%" valign="top"&gt;&lt;? echo $text['40'] ?&gt; :&lt;/td&gt;
    &lt;td width="50%"&gt;&lt;textarea rows="7" name="description" cols="26"&gt;&lt;/textarea&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="50%" valign="top"&gt;&lt;? echo $text['22'] ?&gt; :&lt;/td&gt;
    &lt;td width="50%"&gt;&lt;input type="password" name="pssw" size="12" maxlength="25"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="50%" valign="top"&gt;&lt;? echo $text['22'] ?&gt; [ &lt;? echo $text['59'] ?&gt; ]:&lt;/td&gt;
    &lt;td width="50%"&gt;&lt;input type="password" name="pssw2" size="12" maxlength="25"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="100%" valign="top" colspan="2"&gt;
    &lt;p align="center"&gt;&lt;input type="submit" value="&lt;? echo $text['72'] ?&gt;"&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;?
 }
 // Form has been submitted
 if(isset($_POST['submit']))
 {
  // Checking if email isn't used before to register a website
  $query = mysql_query("SELECT COUNT(1) FROM " . $table . "_sites WHERE email = '" . $_POST['email'] . "'");
  $result = mysql_result($query,0);
  // If email has been registered, give error
  if(!empty($result))
  {
?&gt;
&lt;table border="1" cellpadding="2" cellspacing="0" width="50%" class="content" align="center"&gt;
  &lt;tr class="title"&gt;
    &lt;td width="100%"&gt;&lt;p align="center"&gt;&lt;? echo $text['73'] ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="100%"&gt;&lt;? echo $text['74'] ?&gt; ...
    &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;?
  }
  else
  { // If email hasn't been registered, run script to add site
?&gt;
&lt;table border="1" cellpadding="2" cellspacing="0" width="50%" align="center"&gt;
  &lt;tr class="title"&gt;
    &lt;td width="100%"&gt;&lt;p align="center"&gt;&lt;? echo $text['73'] ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr class="content"&gt;
    &lt;td width="100%"&gt;
&lt;?
   // If sitename wasn't filled in
   if(empty($_POST['sitename']))
   {
?&gt;
      &lt;? echo $text['75'] ?&gt;
      &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;
&lt;?
   }
   // If URL wasn't filled in
   elseif(empty($_POST['url']))
   {
?&gt;
      &lt;? echo $text['76'] ?&gt;
      &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;";
&lt;?
   }
   // If email wasn't filled in
   elseif(empty($_POST['email']))
   {
?&gt;
      &lt;? echo $text['77'] ?&gt;
      &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;
&lt;?
   }
   // If description wasn't filled in
   elseif(empty($_POST['description']))
   {
?&gt;
      &lt;? echo $text['78'] ?&gt;
      &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;
&lt;?
   }
   // If password / confirm password weren't filled in
   elseif(empty($_POST['pssw']) OR empty($_POST['pssw2']))
   {
?&gt;
      &lt;? echo $text['79'] ?&gt;
      &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;
&lt;?
   }
   else
   {
    // If passwords are not the same 
    if($_POST['pssw'] != $_POST['pssw2'] OR empty($_POST['pssw']) OR empty($_POST['pssw2']))
    {
?&gt;
      &lt;? echo $text['61'] ?&gt; ...
      &lt;br&gt;&lt;br&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;&lt; &lt;? echo $text['20'] ?&gt;&lt;/a&gt;
&lt;?
    }
    else
    {
     // Not encrypted version of password
     $pssw = $_POST['pssw'];
     // Encrypted version of password
     $pssw_encrypted = md5($_POST['pssw']);
     $_POST['country'] = str_replace("flag_","", $_POST['country']);
     $_POST['country'] = str_replace(".gif","", $_POST['country']);
     $date = date("dmY");
</code></pre>
]]></description><link>https://dev.connect.gt/post/582485</link><guid isPermaLink="true">https://dev.connect.gt/post/582485</guid><dc:creator><![CDATA[vincenzol]]></dc:creator><pubDate>Tue, 21 Aug 2007 18:48:29 GMT</pubDate></item><item><title><![CDATA[Reply to Aiuto con applicazione CAPTCHA on Tue, 21 Aug 2007 17:34:39 GMT]]></title><description><![CDATA[<p dir="auto">avanti posta pure il codice!</p>
]]></description><link>https://dev.connect.gt/post/582480</link><guid isPermaLink="true">https://dev.connect.gt/post/582480</guid><dc:creator><![CDATA[gabrielem]]></dc:creator><pubDate>Tue, 21 Aug 2007 17:34:39 GMT</pubDate></item><item><title><![CDATA[Reply to Aiuto con applicazione CAPTCHA on Tue, 21 Aug 2007 16:22:50 GMT]]></title><description><![CDATA[<p dir="auto">Avrei linkato la persona che mi avrebbe aiutato</p>
]]></description><link>https://dev.connect.gt/post/582484</link><guid isPermaLink="true">https://dev.connect.gt/post/582484</guid><dc:creator><![CDATA[vincenzol]]></dc:creator><pubDate>Tue, 21 Aug 2007 16:22:50 GMT</pubDate></item><item><title><![CDATA[Reply to Aiuto con applicazione CAPTCHA on Tue, 21 Aug 2007 16:12:01 GMT]]></title><description><![CDATA[<p dir="auto">Si certo!</p>
<p dir="auto">Che cosa intendevi con:</p>
<blockquote>
<p dir="auto"><strong>VincenzoL</strong></p>
<p dir="auto">P.s il lavoro e l'aiuto verranno ricambiati assolutamente!</p>
</blockquote>
<p dir="auto">?</p>
]]></description><link>https://dev.connect.gt/post/582479</link><guid isPermaLink="true">https://dev.connect.gt/post/582479</guid><dc:creator><![CDATA[gabrielem]]></dc:creator><pubDate>Tue, 21 Aug 2007 16:12:01 GMT</pubDate></item><item><title><![CDATA[Reply to Aiuto con applicazione CAPTCHA on Tue, 21 Aug 2007 16:03:31 GMT]]></title><description><![CDATA[<p dir="auto">Se ti posto il codice dello script gli sapresti applicare qualche protezione?</p>
]]></description><link>https://dev.connect.gt/post/582482</link><guid isPermaLink="true">https://dev.connect.gt/post/582482</guid><dc:creator><![CDATA[vincenzol]]></dc:creator><pubDate>Tue, 21 Aug 2007 16:03:31 GMT</pubDate></item><item><title><![CDATA[Reply to Aiuto con applicazione CAPTCHA on Tue, 21 Aug 2007 16:02:25 GMT]]></title><description><![CDATA[<p dir="auto">Il problema dei CAPTCHA è che ultimamente i BOT riecono a leggerli sempre meglio, ci sono soluzioni migliori, e molto più semplici...</p>
]]></description><link>https://dev.connect.gt/post/582478</link><guid isPermaLink="true">https://dev.connect.gt/post/582478</guid><dc:creator><![CDATA[gabrielem]]></dc:creator><pubDate>Tue, 21 Aug 2007 16:02:25 GMT</pubDate></item></channel></rss>