Answers

Question and Answer:

  Home  Senior PHP Programmer

⟩ How will you redirect a page using PHP?

The PHP header() function supplies raw HTTP headers to the browser and can be used to redirect it to another location. The redirection script should be at the very top of the page to prevent any other part of the page from loading. The target is specified by the Location: header as the argument to the header() function. After calling this function the exit() function can be used to halt parsing of rest of the code.

 171 views

More Questions for you: