Three ways to achieve redirection in php

  • header() function;
    header('location:http://www.baidu.com');

     

  • meta tag;
    echo '<meta http-equiv="refresh" content="1;url=http://www.baidu.com">';
    

     

  • script tag;
    echo '<script>window.location.href="http://www.baidu.com"</script>';
    

     

Guess you like

Origin blog.csdn.net/qq_43737121/article/details/113062251