29 February 2020

How to Alternative to “header” for re-directs in PHP


Alternative to “header” for re-directs in PHP



function redirect($url)
{
    if (!headers_sent())
    {   
        header('Location: '.$url);
        exit;
        }
    else
        { 
        echo '<script type="text/javascript">';
        echo 'window.location.href="'.$url.'";';
        echo '</script>';
        echo '<noscript>';
        echo '<meta http-equiv="refresh" content="0;url='.$url.'" />';
        echo '</noscript>'; exit;
    }
}

No comments:

Post a Comment

How to add re-captcha v3 on all Elementor forms using coding?

 Add re-captcha v3 on all Elementor forms using coding add_action('wp_footer',function(){     ?> <script src="https://www...