
| | |||||||
| Website Development HTML, traffic, hosting, and more... this is the forum for every webmaster. |
Register Now for FREE! | |||||
| |

| | LinkBack | Thread Tools | Display Modes |
| |||
| Hi, I am Iorgutu, and i started this thread because need some help . I want to implement a PhP Captcha Script on my website and I don`t know where I found a good captcha, free or paid. If you have a sugestion, please let me know. |
| Sponsored Links | ||
| |
| ||||
| Hi there iorgutu1, Firstly, welcome to CompuForums. I hope that you can visit our forum often in the future and post - rather than just receiving our help and advice, and then never visiting again. We provide our help for free, and all we ask in return is that you participate in our forum and refer your friends, or consider a premium membership. Could you provide a link to your website or tell us if it's a prewritten script you are using or a custom one?
__________________ Thanks, Ash CF Founder Great Webhosting. Shared starting at $2 per month. VPSes starting at $6 per month. www.Centicero.com Want to get in touch? Send me a PM | Do you want to continue receiving free help? Or do you want this site to close? Become a premium member. |
| |||
| Try this: In general the process of using CAPTCHA can be divided into two stages. First you have to query the user for the CAPTCHA, on that page you also usually let the user input the data, which has to be protected, e.g. blog entries. The following script query.php implements this querying phase. Code: <?php
require 'CaptchasDotNet.php';
// Required Parameters
// Replace the values you receive upon registration at http://captchas.net.
//
// client: 'demo'
//
// secret: 'secret'
//
// Optional Parameters and defaults
//
// repository_prefix: '/tmp/captchasnet-random-strings' path to repository
// ATTENTION SAFE-MODE, YOU HAVE TO CHOOSE SOMETHING LIKE
// '/writable/path/captchasnet-random-strings'
//
// cleanup_time: '3600' (means max 1 hour between query and check)
//
// alphabet: 'abcdefghijklmnopqrstuvwxyz' (Used characters in captcha)
// We recommend alphabet without ijl: 'abcdefghkmnopqrstuvwxyz'
//
// letters: '6' (Number of characters in captcha)
//
// width: '240' (image width)
//
// height: '80' (image height)
//
// Usage
// $captchas = new CaptchasDotNet (<client>, <secret>,
// <repository_prefix>, <cleanup_time>,
// <alphabet>,<letters>,
// <height>,<width>);
//
// Don't forget same settings in check.asp
// Construct the captchas object.
$captchas = new CaptchasDotNet ('demo', 'secret',
'/tmp/captchasnet-random-strings','3600',
'abcdefghkmnopqrstuvwxyz','6',
'240','80');
?>
<html>
<head>
<title>Sample PHP CAPTCHA Query</title>
</head>
<h1>Sample PHP CAPTCHA Query</h1>
<form method="get" action="check.php">
<table>
<tr>
<td>
<input type="hidden" name="random" value="<?= $captchas->random () ?>" />
Your message:</td><td><input name="message" size="60" />
</td>
</tr>
<tr>
<td>
The CAPTCHA password:
</td>
<td>
<input name="password" size="6" />
</td>
</tr>
<tr>
<td>
</td>
<td>
<?= $captchas->image () ?>
<br> <a href="<?= $captchas->audio_url () ?>">Phonetic spelling (mp3)</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
<input type="submit" value="Submit" />
</td>
</tr>
</table>
</form>
</html> The second part is to check, whether the user has input the correct letter sequence (as given by the CAPTCHA image or audio). If that is the case the protected operation can be performed. Otherwise the corresponding error message is to be output. There are two ways, in which a CAPTCHA check can fail. The user can have simply input the wrong letters. But also the random string can have been used more than once. If you would allow a random string to be used multiple times, a human could find out the correct CAPTCHA letter sequence for one random string once and use that information to make a robot post non-human entries to your web application, which still would seem made by a human. The following script check.php implements this checking phase. Code: <?php
require 'CaptchasDotNet.php';
// See query.php for documentation
$captchas = new CaptchasDotNet ('demo', 'secret',
'/tmp/captchasnet-random-strings','3600',
'abcdefghkmnopqrstuvwxyz','6',
'240','80');
// Read the form values
$message = $_REQUEST['message'];
$password = $_REQUEST['password'];
$random_string = $_REQUEST['random'];
?>
<html>
<head>
<title>Sample PHP CAPTCHA Query</title>
</head>
<h1>Sample PHP CAPTCHA Query</h1>
<?php
// Check the random string to be valid and return an error message
// otherwise.
if (!$captchas->validate ($random_string))
{
echo 'Every CAPTCHA can only be used once. The current CAPTCHA has already been used. Try again.';
}
// Check, that the right CAPTCHA password has been entered and
// return an error message otherwise.
elseif (!$captchas->verify ($password))
{
echo 'You entered the wrong password. Aren\'t you human? Please use back button and reload.';
}
// Return a success message
else
{
echo 'Your message was verified to be entered by a human and is "' . $message . '"';
}
?>
</html> If your webserver starts PHP-scripts in the safe mode, you will not be able to leave the default path to the random string repository unchanged. Instead use a name in a directory, which the owner of the PHP-script owns: Code: .
.
.
require 'CaptchasDotNet.php';
$captchas = new CaptchasDotNet ('demo', 'secret',
'/writable/path/captchasnet-random-strings');
.
.
. |
| |||
| Thank you very much for your recomandation, seems very good, I hope don`t require links back. I will try it. I will still check a few other before I decide which one I will use on the long term. ![]() ________________________ This user added the following: ________________________ I searched on Hotscripts.com :: The net's largest PHP, CGI, Perl, JavaScript and ASP script collection and resource web portal com and I also found I also found Captcha Creator Captcha Creator - PHP Script Package which seems easy to install and works nice. Last edited by iorgutu1; 05-20-2007 at 06:29 PM. Reason: Double Post |
| ||||
| I hope you could link back to us for our help, or just keep visiting us and telling your friends about CompuForums
__________________ Thanks, Ash CF Founder Great Webhosting. Shared starting at $2 per month. VPSes starting at $6 per month. www.Centicero.com Want to get in touch? Send me a PM | Do you want to continue receiving free help? Or do you want this site to close? Become a premium member. |
| |||
| Quote:
Sure, thanks again for your help, I tell my friends about this forum, and when I starts my website I will put a link back for you. |