Adding Recaptcha.net Widget to Forms

This info applies to versions 1.2 and above.

Adding Recaptcha.net Widget to Forms

Postby Admin on Mon Jan 05, 2009 10:06 pm

You can quite easily add captcha widget from Recaptcha.net to your Domainer Script site.

You must sign-up to a new account at www.recaptcha.net if you haven't done so already. You will receive public and private keys.

You will be selecting the PHP instructions from the recaptcha.net site.

On your Domainer Script-powered site, you will be editing the following file:

template/template-name/body.php

1.
Open the body.php page and locate the code that says:

case 'contact':

This appears at or around line 10 (if you are using a html/php authoring tool like Dreamweaver).

Create a new line right after that line and add the recaptcha.net code with public-key.

2.
In the same file, locate the code that says:

<form action="<? print $url; ?>?action=contact" method="post" name="contact">

This appears at or around line 282.

Scroll down until you see this:

<tr>
<td colspan="2" align="center"><table>
<tr>
<td><input name="Reset" type="reset" value="Reset"></td>
<td><input name="Send" type="submit" value="Send"></td>
</tr>
</table></td>
</tr>


Just above the above snippet of code create a new line and add the following code:

<tr><td colspan="2"><? (insert recaptcha.net code with public-key here) ?></td></tr>

Almost done.

3.
Locate the following:

//
// PREDEFINED PAGE "CONTACT"
//


It appears at or around line 452

Scroll down to where you see the line that reads: <tr><td colspan="2"><p align="center">* Required fields</p></td></tr>

Create a new line and add the following:

<tr><td colspan="2"><? (insert recaptcha.net code with public-key here) ?></td></tr>

One more change to go.

4.
Then, a few lines down you will see a line that reads: case 'contact-process':

Create a new line right after and insert the recaptcha.net code with the private-key.

That's it. Now upload the files and upload recaptchalib.php to your site's root directory.
Admin
Site Admin
 
Posts: 14
Joined: Thu Nov 06, 2008 2:34 pm

Return to Versions 1.xxx

Who is online

Users browsing this forum: No registered users and 1 guest

cron