WordPress.org

Ready to get started?Download WordPress

Forums

Captcha
[resolved] Adding to custom form (6 posts)

  1. moggy17
    Member
    Posted 1 year ago #

    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/

  2. majestsick
    Member
    Posted 1 year ago #

    I also need help doing this lol

  3. bestwebsoft
    Member
    Plugin Author

    Posted 1 year ago #

    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

  4. 100pp
    Member
    Posted 1 month ago #

    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

  5. Chris Dillon
    Member
    Posted 1 month ago #

    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".

  6. bestwebsoft
    Member
    Plugin Author

    Posted 1 month ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.