plugin development - how to add security questions on wp-registration page and validate it

I wanted to validate security questions which show's on wp-login page validation is if answers are blank user cant

I wanted to validate security questions which show's on wp-login page validation is if answers are blank user cant login and if user register with 2 questions and admin change no. question show on login page then validation is if user given all 2 answer which he registered then he login that time not check 3rd question becoz he not registered 3 ques.so, how to add security questions on wp-registration page and after that validate that question on wp-login page

    if ( is_array( wp_unslash( $_POST['seq_ques'] ) ) ) {

            foreach ( $_POST['seq_ques'] as $key_ques => $quest ) 
            {
                for($i=1; $i <= count($all_userans); $i++)
                {   
                    if ( wp_unslash( $_POST['seq_ans'] ) ) :
                    foreach ( wp_unslash( $_POST['seq_ans'] ) as $question => $answer ) :
                        for($i=1; $i <= count($all_userans); $i++)
                        {

                            if ( empty( $answer ) ) {
                              unset($_POST['seq_ans'] [$question]); 
                                $empty_answer = true;echo 'empty';// exit();
                            }
                        }
                    endforeach;
            endif;

                    if ( ! array_key_exists( $quest,$all_userans ) ) {
                        //$is_error_question = true;
                        $is_error_answer = true;    $incorrect_answer = true; 
                        echo "array_key_exists";// break;
                    } else
                         {
                            $user_ques[ $question ] = $question ;
                         }

                }
            }

        }

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745366106a4624586.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信