.
Here are those bits of code that does this 'secnum' ckeck in
As you can see a combination of a filter string
and current date is used:
$secnumber .= $settings['filter_sum'] . date('dmy');
<?php
/* Checksum - just type some digits or chars. Used to help prevent SPAM */
$settings['filter_sum']='du3psfwewr';
//////////////////////////////////////////////////
/* And this will start session which will help prevent multiple submissions */
if($a=='add') {
session_start();
if (empty($_SESSION['checked'])) {
$_SESSION['checked']='N';
$_SESSION['secnum']=rand(10000,99999);
$_SESSION['checksum']=$_SESSION['secnum'];
session_regenerate_id();
}
}
/////////////////////////////////////////////////////
if ($_SESSION['checked'] == 'N')
{
print_secimg($name,$from,$email,$url,$comments,$isprivate);
}
elseif ($_SESSION['checked'] == $settings['filter_sum'])
{
$_SESSION['checked'] = 'N';
$secnumber=gbook_isNumber($_REQUEST['secnumber']);
if(empty($secnumber)) {print_secimg($name,$from,$email,$url,$comments,$isprivate,1);}
$secimg=check_secnum($secnumber,$_SESSION['checksum']);
if (empty($secimg))
{print_secimg($name,$from,$email,$url,$comments,$isprivate,2);}
}
////////////////////////////////////////////
function check_secnum($secnumber,$checksum) {
global $settings;
$secnumber.=$settings['filter_sum'] . date('dmy');
if ($secnumber == $checksum)
{
unset($_SESSION['checked']);
return true;
}
else
{
return false;
}
} // END check_secnum
?>
<p> </p>
<p>This is a security check that prevents automated signups of this guestbook (SPAM).
Please enter the security number displayed below into the input field and click
the continue button.</p>
<p> </p>
<p>Security number: <b><?php echo $_SESSION['secnum']; ?></b><br>
Please type in the security number displayed above:
<input type="text" size="7" name="secnumber" maxlength="5" id="input"></p>