Captcha

eFiction way:

if($captcha && !isMEMBER && !captcha_confirm()) $output .= write_error(_CAPTCHAFAIL);

if(!USERUID && !empty($captcha)) $output .= "<tr><td><span class='label'>"._CAPTCHANOTE."</span></td><td><img width=120 height=30 src='"._BASEDIR."includes/button.php' alt='CAPTCHA image'><br /><br /><input MAXLENGTH=5 SIZE=5 name='userdigit' type='text' value=''></td></tr>";

$output .= "<tr><td><label for='comments'>"._COMMENTS.":</label></td><td> <TEXTAREA  class='textbox' name='comments' cols='50' rows='6'></TEXTAREA></td></tr>";
  • includes/button.php

  • includes/plain.button.php

e107 way:

e_header.php

$newcaptcha = efiction_settings::get_single_setting('captcha');  

if($newcaptcha && extension_loaded('gd'))
{
	define('USE_IMAGECODE', TRUE);
}
else
{
	define('USE_IMAGECODE', FALSE);
}

in report.php

  • handler : $sec_image = e107::getSecureImg();

captcha test

if (USE_IMAGECODE && isset($_POST['rand_num']) && (e107::getSecureImg()->invalidCode($_POST['rand_num'], $_POST['code_verify']))) {

form rendering

 if (!USERUID && USE_IMAGECODE) {
    		//one table field to be able to use recaptcha
    		$output .= "<tr><td><label for='code_verify'>".e107::getSecureImg()->renderLabel().'</label>';
    		$output .= e107::getSecureImg()->renderimage();
    		$output .= e107::getSecureImg()->renderInput().'</td></tr>';
 }
e107 recaptcha rendered on former contact page

in reviewform.php

in user/contact.php

in challenges.php

in user/editbio.php

Last updated