Support » Plugin: Captcha by BestWebSoft » Adding to custom form

  • Resolved moggy17

    (@moggy17)


    HI

    Im trying to add the authentication to a custom form

    the verification code at the top is

    //INITIALIZE VARIABLES
        $name_error = '';
        $email_error = '';
        $subject_error = '';
        $message_error = '';
        //GET CUSTOM THEME OPTIONS
    	if (isset($_REQUEST['c_submitted']))
    	{
    		if($_REQUEST['c_submitted'])
    		{
    			$c_name = trim($_REQUEST['c_name']);
    			$c_email = trim($_REQUEST['c_email']);
    			$c_subject = trim($_REQUEST['c_subject']);
    			$c_message = trim($_REQUEST['c_message']);
    
    			//SEND EMAIL IF THERE ARE NO ERRORS
    			if($error != true)
    			{
    				$email_to =$queed_frontend_options['email_address'];
    				$message_body = "Name: $c_name \n\nEmail: $c_email \n\nComments: $c_message";
    				$headers = "From: ".get_bloginfo('title')."\r\n" .'Reply-To: ' . $c_email;
    				mail($email_to, $c_subject, $message_body, $headers);
    				$email_sent = true;
    			}
    		}
    	}
    ?>

    I’ve put the question into the form which displays fine but i’m not sure what to do with the error checking bit I added it but it it still sent the form

    any suggestions?

    cheers

    http://wordpress.org/extend/plugins/captcha/

Viewing 5 replies - 1 through 5 (of 5 total)
  • I also need help doing this lol

    Plugin Author bestwebsoft

    (@bestwebsoft)

    Hello moggy17,

    You should add the functions of checking where the form validation runs.

    if( function_exists( 'cptch_check_custom_form' ) &&
    cptch_check_custom_form() !== true ) echo "Please complete the
    CAPTCHA."

    or

    <?php if( function_exists(
    'cptch_check_custom_form' ) && cptch_check_custom_form() !==
    true ) echo "Please complete the CAPTCHA." ?>

    We can help you with it, but this is a paid service.
    Is it ok for you?

    Kind regards,
    Support Team

    Karsten

    (@100pp)

    Many people have the same question. Me, too.

    Why can´t you explain, where exactly to put the code?

    What does this mean?

    “You should add the functions of checking where the form validation runs.”

    Thanks,
    Karsten

    Chris Dillon

    (@cdillon27)

    Karsten,

    To be fair, it’s not as simple as dropping in a few lines of code; it requires a certain amount of web development knowledge.

    Here’s a gist to demonstrate adding Captcha to a custom form and checking the result. Look for “using Captcha plugin”.

    Plugin Author bestwebsoft

    (@bestwebsoft)

    Hi 100pp,

    “Why can´t you explain, where exactly to put the code?” – because there isn’t a standard way to write contact forms. Every developer creates a contact form the way they like. If you have the necessary coding skills you will understand where to insert the necessary lines. If no – it is better to consult a developer with the appropriate coding skills.

    “What does this mean?” – it means that there is a fragment of code that is responsible for checking the data that come to the server via the form located on the site.

    To Chris,

    “Here’s a gist to demonstrate adding Captcha to a custom form and checking the result. Look for “using Captcha plugin”. – Thank you, this information may be rather useful.

    Sincerely,
    BestWebSoft Support Team

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adding to custom form’ is closed to new replies.