WordPress redirect issue with php

i have some users in my db. The PHP script pick the users accurately, but redirect not working.

Please help any one my script is below:

if($sqlquery==1)
{
    $_SESSION['email']=$email;
    $_SESSION['password']=$password;
    wp_redirect( 'https://mcqpage.com/somepage', 301 );
    exit; 
} 
else
{
    header("location:http://www.mcqpage.com/index.php"); 
}  

Read more here: WordPress redirect issue with php

Leave a Reply

Your email address will not be published. Required fields are marked *