Alternative to “header” for re-directs in PHP

前端 未结 8 1601
旧时难觅i
旧时难觅i 2020-12-05 06:16

I am working on a project and I am required to run my program on someone else\'s webserver. It is a pretty simple login page that I am having the problem with. The program

相关标签:
8条回答
  • 2020-12-05 06:43

    From the docs:

    Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP.

    Your echo is causing the redirect to fail, as is any other output sent before the header.

    0 讨论(0)
  • 2020-12-05 06:44
    Use This Code 
    

    Syntax :

      echo '<script type="text/javascript"> window.location="<Your_URL>";</script>';
    
    
    write this line insted of header("location: UI.php");
    
    
       echo '<script type="text/javascript"> window.location="UI.php";</script>';
    
    0 讨论(0)
提交回复
热议问题