Support » Themes and Templates » Login Form Honey Pot

Viewing 3 replies - 1 through 3 (of 3 total)
  • *The new field shows fine, and it redirects properly BUT only if an invalid username and password is entered….

    This does the trick.

    	//Add the new form field
    	//name the input body, better chance of attracting bots
        function myLogin_honeypot_form (){
            $body = ( isset( $_POST['body'] ) ) ? $_POST['body']: '';
            <p id="notThere">
                <label for="body"><?php _e('If you can see the below box, do not input any text. This is a test.','mydomain') ?><br />
                <input type="text" name="body" id="body" class="input" value="<?php echo esc_attr(stripslashes($body)); ?>" size="25" /></label>
    	//add the field processing
    	function myLogin_HoneyPot_Error(){
    	if( strlen( $_POST['body'] ) > 0 ){
    			//login uses a string for error handling
    			//if login error is set the login for will still process, so we have to sabotage the login variable $username
    			$error = sprintf( __( '<strong>ERROR</strong>: Invalid Login. <a href="%s" title="Password Lost and Found">Lost your password</a>?' ), wp_lostpassword_url() );
    			$username = '';
    			return $error;

    Hide the field with

    display: none;
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Login Form Honey Pot’ is closed to new replies.