Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Answered | Installing CAPTCHA - Where to put these two PHP codes? (http://www.mysidiaadoptables.com/forum/showthread.php?t=1283)

Quillink 01-24-2010 09:54 AM

Answered | Installing CAPTCHA - Where to put these two PHP codes?
 
Hey guys,

[Please see next post. You can download my register.php from this one, i fit will help]

Thanks VERY much in advance,
- Quillink

Quillink 01-27-2010 12:13 AM

RE: Installing "Securimage CAPTCHA" - need help placing two sections of code (PHP)
 
Ok I think the prospect of downloading and following a tutorial is chasing people away, so I'll try a different approach:


Can anyone help me with placing these two code extracts in my register.php? It's the validation process for my Securimage CAPTCHA:

Code:

include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';

$securimage = new Securimage();

And

Code:

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.');
}


Alternatively, does anyone know of a simpler CAPTCHA process? Maybe one you made yourself?

Thanks in advance

BMR777 01-27-2010 04:45 PM

RE: Installing CAPTCHA - Where to put these two PHP codes?
 
I would suggest ReCaptcha:

http://recaptcha.net/

Adding that would be super easy.

To use the one you are using though, maybe something like...

Find:

PHP Code:

else{

    
//We are attempting to register the user...

    //First MD5 hash the passwords:

    
$pass1 md5($pass1);
    
$pass2 md5($pass2); 

Replace With:

PHP Code:

else{

    
//We are attempting to register the user...

include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';

$securimage = new Securimage();

    
//First MD5 hash the passwords:

    
$pass1 md5($pass1);
    
$pass2 md5($pass2); 

Find:

PHP Code:

    else if($tos != "yes"){

    
//User did not agree to TOS
    
$article_title "Terms of Service Error";
    
$article_content $notos;

    } 

Replace With:

PHP Code:

else if($tos != "yes"){

    
//User did not agree to TOS
    
$article_title "Terms of Service Error";
    
$article_content $notos;

    }
else if(
$securimage->check($_POST['captcha_code']) == false){

// The captcha is wrong, put your message here...

$article_title "Captcha Incorrect";
$article_content "Captcha Incorrect";



Try that and see if it works. :)

Quillink 01-27-2010 11:24 PM

RE: Installing CAPTCHA - Where to put these two PHP codes?
 
Thanks Brandon, it's all working now. :D

I don't know how I missed it before, I forgot to edit the
Code:

include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';
to point to where I put the file. It wasn't working because it's in another directory..!

Always one sentence of code that'll cost you hours, isn't it lol?


Thanks again.

SieghartZeke 01-28-2010 02:02 AM

RE: Answered | Installing CAPTCHA - Where to put these two PHP codes?
 
Ehm wait a moment...i don't know where you can download ReCaptcha!
Im registrated, added my site to the list...but...WHERE IS THE DOWNLOAD LINK???

Tequila 01-28-2010 08:56 AM

RE: Answered | Installing CAPTCHA - Where to put these two PHP codes?
 
Quote:

Originally Posted by SieghartZeke
Ehm wait a moment...i don't know where you can download ReCaptcha!
Im registrated, added my site to the list...but...WHERE IS THE DOWNLOAD LINK???

All the information is available on the Resources page.
Quote:

There are three ways to use reCAPTCHA: with an application plugin, with a library for your programming language, or with the web-based API. The following resources will help you find the correct method to add our CAPTCHA in your environment.
I'll try installing later on, still have cleaning to do.

SieghartZeke 01-28-2010 09:26 AM

RE: Answered | Installing CAPTCHA - Where to put these two PHP codes?
 
And what of this i need to choose??

Seapyramid 01-29-2010 01:22 AM

RE: Answered | Installing CAPTCHA - Where to put these two PHP codes?
 
Try reading & learning.. the info is there if you want it.

SieghartZeke 01-29-2010 03:46 AM

RE: Answered | Installing CAPTCHA - Where to put these two PHP codes?
 
IM Italian and some thing I don't know...i have only 14 years,,,

Tequila 01-29-2010 07:26 AM

RE: Answered | Installing CAPTCHA - Where to put these two PHP codes?
 
Quote:

Originally Posted by SieghartZeke
IM Italian and some thing I don't know...i have only 14 years,,,

Try looking at this blog post on how to use it with PHP (which is what I'm doing first). I wish I could recommend a good free translation service, but none of them convey correctly (take it from an artist who has to send Cease and Desist letters to people outside of the English speaking community).


All times are GMT -5. The time now is 04:16 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.