php - unable to redirect on wp-admin page -


i m facing problem while implementing captcha code on wp-login.php. want redirect on wp-admin page of website when captcha code maches. there way redirect on wp-admin page?? code :

function captcha_login_check($url) {     if (isset($_post["security_check"]))      {         $code = str_decrypt($_post["security_check"]);         if (!( $code == $_post['security_code'] && !empty($code) ))         {             wp_clear_auth_cookie();             return $_server["request_uri"];             ?>             <span style="color:red">             error, security code not match. please try again.             </span>             <br>             <?php         }         else         {             $url = $_server['http_host']."/wp-admin/";             return $url;         }     } } 

use like

    else     {         $url = $_server['http_host']."/wp-admin/";         header('location:'.$url);     } 

also can use this

    else     {         $url = $_server['http_host']."/wp-admin/";                echo ("<script>location.href='$url'</script>");     } 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -