Etomite Community Forums: Guestbook2 with captcha and spam - Etomite Community Forums

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Guestbook2 with captcha and spam

#1 User is offline   sandra-ch 

  • Etomite Forum Newbie
  • Group: Member
  • Posts: 43
  • Joined: 05-May 05
  • Location:Switzerland

Post icon  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 File(s)



#2 User is offline   PaulD 

  • Likes Etomite Forums!
  • PipPip
  • Group: Member
  • Posts: 299
  • Joined: 06-February 06
  • Gender:Male
  • Location:Lutterworth, Leicestershire

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.

This post has been edited by PaulD: 29 May 2009 - 01:03 AM


#3 User is offline   sandra-ch 

  • Etomite Forum Newbie
  • Group: Member
  • Posts: 43
  • Joined: 05-May 05
  • Location:Switzerland

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

This post has been edited by sandra-ch: 04 June 2009 - 07:51 PM


#4 User is offline   sandra-ch 

  • Etomite Forum Newbie
  • Group: Member
  • Posts: 43
  • Joined: 05-May 05
  • Location:Switzerland

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 File(s)



#5 User is offline   Cris D. 

  • Loves Etomite Forums!
  • PipPipPipPip
  • Group: Member
  • Posts: 1,065
  • Joined: 10-August 06
  • Location:Brisbane, Queensland, Australia

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.

This post has been edited by Cris D.: 16 June 2009 - 09:52 PM


#6 User is offline   Ralph 

  • Etomite Administrator
  • Icon
  • Group: Admin
  • Posts: 6,370
  • Joined: 01-July 04
  • Gender:Male
  • Location:Jamestown, NY USA
  • Interests:Computers, Camping, Hiking, Aviation

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...

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users