PDA

View Full Version : Using Captcha in another form


Shannon Hutcheson
05-21-2006, 08:38 PM
I have a few other forms for my website that I'd like to use the esyndicat built in captcha option. These forms are already included in the esyndicat templates via the new page feature.

What specific code do I need to include within the form tags to get the captcha to work with my own forms?

here's one of the forms I want to include the captcha feature on:
http://www.cattery-index.com/links/plink_exchange.html

p.s. I'm getting majorly spammed via this form. I'd appreciate an answer on this asap :sos:

Shannon Hutcheson
05-24-2006, 01:30 AM
anyone? come on, I'm getting majorly spammed. It can't be that hard to do?

Nick Collins
05-24-2006, 09:37 AM
Sorry for delay with answer :( Here is a solution:
1. Open your form action php file (feedback.php in your case)
a) after "<?php" add the following line:
session_start();
b) ad the following code where is POST processing (I can not say exactly place as I didn't see you php file):
/** check for captcha **/
if ($gDirConfig['captcha'] && ('add' != $_POST['action']))
{
$sc1 = $_POST['security_code'];
$sc2 = $_SESSION['pass'];
if (strcmp($sc1, $sc2))
{
$error = true;
$msg .= " {$gDirLang['error_captcha']}";
}
}
***save changes***

2. Open tpl file where is form located
***find the following code:***
<input type="submit" bla bla bla />
***before add,***
<p class="field">{$config.base}{$config.dir}plugins/captcha/image.php
<input type="text" name="security_code" /></p>
***save***
That's all!

Shannon Hutcheson
05-24-2006, 12:31 PM
There is no feedback.php file in my install, anywhere.

:(

still lost

Shannon Hutcheson
05-25-2006, 11:17 PM
oops, started another thread. Didn't know how to see the old ones after the forum switched.

Simon is helping me in the other thread. Can close this one or merge them I suppose.

Nick Collins
05-26-2006, 07:32 AM
Ok, I have already closed this thread.