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条)