|
Posted by bish on 02/18/06 02:11
On 17 Feb 2006 11:04:08 -0800, "ZeldorBlat" <zeldorblat@gmail.com>
wrote:
>>>
>>>Blackhawk@idonthaveone.com wrote:
>>>> I have a guest book and someone is raising hell with me on it. I must
>>>> receive 50 entries a day and all bogus. Don't know why they have
>>>> picked my site but I have to do something now to correct the on going
>>>> problem.
>>>>
>>>> I need a security feature for my guest book. I have seen some on other
>>>> boards where there is a series a letters and or numbers only the human
>>>> eye can pick out and enter in order to submit an entry into the guest
>>>> book. Can someone direct me to the source of this security script in
>>>> php, please!
>>>
>>><http://www.google.com/search?q=captcha>
I'm not a php expert, and the following kludge will doubtless
offend the purists, but my restaurant site no longer struggles
under the 200 or 300 daily entries it used to.
Hope the comments make sense.
<?
// anti-spam header location;
// stops people posting with an e-mail address ;
// supposedly coming from your domain name ;
if (strpos($email, "@your_domain"))
{
header("location:guest_book_entry.php");
exit();
}
// I have only 4 fields on my guest book;
// check for any blank fields;
if ((!$firstname) || (!$surname) || (!$email) || (!$comments))
{
header("location:guest_book_entry.php");
exit();
}
// check to decline successive entries of data from ;
// identical sources. The snag with this is that a genuine ;
// entrant may wish to enter a correction. If s/he is the very ;
// next entrant this correction will not be accepted. ;
// However, we answer all guest book entries within 24 ;
// hours by e-mail, so that is their chance to correct things.;
include("php-lib/connect_inc.php");
$TableName="your_guest_book";
$Query="SELECT * FROM $TableName order by id desc limit 1";
$Result=mysql_db_query ($DBName, $Query, $Link);
while ($Row=mysql_fetch_array ($Result))
{
if ( ($firstname==$Row[firstname]) and ($surname==$Row[surname]) )
{
header("location:guest_book_entry.php");
exit();
}
}
?>
Hope This Helps.
Navigation:
[Reply to this message]
|