Jump to content


Guestbook2 with captcha and spam


  • You cannot reply to this topic
5 replies to this topic

#1 sandra-ch

    Etomite Forum Newbie

  • Member
  • 43 posts

Posted 28 May 2009 - 10:44 PM

hi
im using Guestbook2 with captcha but i'm receiving spamentries.
could somebody please look into the code and help me?

the link to the guestbook is http://www.bern-yoga.ch/gbuch.html

thks in advance
sandra-ch

Attached Files



#2 PaulD

    Likes Etomite Forums!

  • Developers
  • PipPip
  • 389 posts
  • Gender:Male

Posted 29 May 2009 - 01:00 AM

Hi sandra-ch,

When your form is submitted with a blank capture code it is still being accepted. Also with wrong input to captch request. I dont think your captcha is working at all.

In fact, I can see that you have switched off the captha code setting to access your manager. That is why the captcha result of 'false' is being ignored. Just switch it on from the configuration panels (cant remember which panel - sorry).

Hope this helps,

Paul.

Edited by PaulD, 29 May 2009 - 01:03 AM.


#3 sandra-ch

    Etomite Forum Newbie

  • Member
  • 43 posts

Posted 30 May 2009 - 07:52 PM

Hi PaulD

thks for the hint about the wrong captcha implementation.
i found the configuration and turn it on.

but i'm not able to fix the code myself.
could you (or anybody else) help me by fixing the code?

the captcha is not working properly and i don't get a message if gbentry failed or a message if gbentry was successfull and i'm still get some unwanted entrys

thks in advance
sandra-ch

Edited by sandra-ch, 04 June 2009 - 07:51 PM.


#4 sandra-ch

    Etomite Forum Newbie

  • Member
  • 43 posts

Posted 16 June 2009 - 06:10 PM

Hi

could anybody help me by fixing the code?

the captcha is not working properly: i don't get a message if captcha is entered wrong or captcha isn't entered.

and i like a message if entry was successfull.

thks in advance
sandra-ch

Attached Files



#5 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 16 June 2009 - 09:51 PM

Captcha needs to be implemented in 2 ways..1) to show the code, 2) to validate the code. See the documentation for the 2 calls that can be used together:

Quote

getCaptchaNumber($length, $alt='Captcha Number', $title='Security Code')

// returns a Captcha Number image to caller and stores value in $_SESSION['captchNumber']
// $length = number of digits to return
// $alt = alternate text if image cannot be displayed
// $title = message to display for onhover event
validCaptchaNumber($number)

// returns Captcha Number validation back to caller - boolean (true|false)
// $number = number entered by user for validation (example: $_POST['captchaNumber'])

Also, if you want to see an example of how this was implemented, you can refer to the etComment snippet that has it integrated:
//Initiate Captcha
 if($useCaptcha == true && isset($_POST['captchaCode']))
 {
	$captchaEntry=htmlentities($_POST['captchaCode']);
 
	if(!$etomite->validCaptchaCode($captchaEntry)) { 
	   $captchaError = true;
	   $errorsOut .=$text['NotValidCaptcha']."<br />";
	   }
 }
if($useCaptcha){
$formArr['captchaInput']='<input type="text" name="captchaCode" />';
$formArr['CaptchaMessage'] = $text['CaptchaMessage'];
$formArr['captcha'] = $etomite->getCaptchaCode();
}

$formChunk .= $etomite->parseChunk($etoCommentForm, $formArr, '{', '}');

If this is too tricky for you to adapt to Guestbook, Ralph may assist.

Edited to fix code block nesting.

Edited by Cris D., 16 June 2009 - 09:52 PM.


#6 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,507 posts
  • Gender:Male

Posted 17 June 2009 - 12:49 PM

The site in question was already fixed before sandra-ch made her last post... CAPTCHA is working... Any remaining issues are related to dated snippet code which could be totally re-written... There is a remote possibility that I may release a new snippet that stores messages in the user_messages table... I started the code yesterday after discovering how old the GuestBook snippets are getting...





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users