I am trying to get CAPTCHA from Securimage to work on my link site. I have added the code up to step 4 explained here http://www.phpcaptcha.org/documentation/quickstart/ to the form.html seen here http://www.MyURL.com/linkman/form.html, but it dose not show here http://www.MyURLcom/linkman/links.php, so I am thinking it needs to be somewhere else but I don't know to much about PHP, so I have not a clue were to put it. As you can see from the background and stuff I have already been messing with it. learn by doing. Also I think I want the links and the form on two different pages. Any help would be great
Thanks James
CAPTCHA add-on
CAPTCHA add-on
Last edited by makoshark on Thu Sep 30, 2010 3:48 pm, edited 2 times in total.
Sincerely, James Niland
Niland Enterprise
askme@nilandsplace.com
(910) 557-9615, 10 AM to 10PM EST
http://nilandsplace.com
Niland Enterprise
askme@nilandsplace.com
(910) 557-9615, 10 AM to 10PM EST
http://nilandsplace.com
Re: CAPTCHA add-on
OK
I found were the form is in links.php and added this to the page now I have to add:
# Open the PHP file that processes the form data after submission.
You can find this by looking at the action value inside your <form> tag.
Note: In order to use Securimage, your form processor must be written in PHP.
# On line 1 of the file, add the following code: and then add:
# The next few steps will vary depending on how form validation is handled in your code.
# To check if the code is correct, we will make a call to the Securimage class. The following php code should be integrated into the script that processes your form near any error checking that takes place. It should be between <?php ?> tags.
next I need to add:
Next we will actually check to see if the code was correct.
then it is supposed to work
I found were the form is in links.php and added this to the page
Code: Select all
<p><b>Website description:</b><br>
<input type="text" name="description" maxlength="200" size="60"></p>
<!-- begin capcha code -->
<img id="captcha" src="http://MyURL.com/securimage/securimage_show.php" alt="CAPTCHA Image" />
<div>
<input type="text" name="captcha_code" size="10" maxlength="6" />
</div>
<a href="#" onclick="document.getElementById('captcha').src = 'http://MyURL.com/securimage/securimage_show.php?' + Math.random(); return false">Reload Image</a>
<!-- end capcha code -->
<p><input type="submit" value="Add link"></p>
</form>
# Open the PHP file that processes the form data after submission.
You can find this by looking at the action value inside your <form> tag.
Note: In order to use Securimage, your form processor must be written in PHP.
# On line 1 of the file, add the following code:
Code: Select all
<?php session_start(); ?>
# The next few steps will vary depending on how form validation is handled in your code.
# To check if the code is correct, we will make a call to the Securimage class. The following php code should be integrated into the script that processes your form near any error checking that takes place. It should be between <?php ?> tags.
Code: Select all
include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';
$securimage = new Securimage();
Next we will actually check to see if the code was correct.
Code: Select all
if ($securimage->check($_POST['captcha_code']) == false) {
// the code was incorrect
// handle the error accordingly with your other error checking
// or you can do something really basic like this
die('The code you entered was incorrect. Go back and try again.');
}
Sincerely, James Niland
Niland Enterprise
askme@nilandsplace.com
(910) 557-9615, 10 AM to 10PM EST
http://nilandsplace.com
Niland Enterprise
askme@nilandsplace.com
(910) 557-9615, 10 AM to 10PM EST
http://nilandsplace.com
Re: CAPTCHA add-on
Well I figured out were to put the code in addlink.php right after line 206 as an elseif, but the captcha just loops.
Sincerely, James Niland
Niland Enterprise
askme@nilandsplace.com
(910) 557-9615, 10 AM to 10PM EST
http://nilandsplace.com
Niland Enterprise
askme@nilandsplace.com
(910) 557-9615, 10 AM to 10PM EST
http://nilandsplace.com