We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3647
    • 177 Posts
    I want to use the captcha with a form template, but I can’t locate any documentation on what I need to add into my template chunk in order to use it.

    The captcha works with a standard Jot call without my template, but not with it so I assume I must add something into the template?

    Can anyone let me know, or point to an example?

    Thanks

    Mark
      • 36592
      • 970 Posts
      I’ve never tried this myself, but I found these lines in Jot default template.
        [+jot.captcha:is=`1`:then=`
      		<div style="width:150px;margin-top: 5px;margin-bottom: 5px;"><a href="[+jot.link.current:esc+]"><img src="[(base_url)]manager/includes/veriword.php?rand=[+jot.seed+]" width="148" height="60" alt="If you have trouble reading the code, click on the code itself to generate a new random code." style="border: 1px solid #003399" /></a></div>
      		<label for="vericode[+jot.id+]">Help prevent spam - enter security code above:<br /><input type="text" name="vericode" style="width:150px;" size="20" id="vericode[+jot.id+]" /></label> 
      	`:strip+]
      

      I guess you have to modify and add these lines to your original template.
        • 1122
        • 209 Posts
        Here are necessary and sufficient guidelines how to handle validation process manually. I have used it on many occasions. You do not need to use captcha exactly in your form -- you can do it wherever you want on the page that is being validated.
        1) include onto your page captcha image (no matter inside or outside your form):
        <img src="/manager/includes/veriword.php" ....... />
        

        --> veriword.php script does two things: it generates random image + it stores image’s content in textual format into the variable $_SESSION[’veriword’]
        2) include into your form a textfield where user should enter verification code
        3) within your script that handles submitted data compare user-provided code with the $_SESSION[’veriword’] variable -- if both values match, user successfully proved his "human nature" smiley