Home php Move to another page in the if statement

Move to another page in the if statement




How do I navigate to another page in PHP? Via require or fopen?

if ($ row_login ['password']! = $ _POST ['password'])
  echo 'Invalid password';
else {
  require ('page.php')

Answer 1

Answer 2, authority 92%

There is such a function header .

header () is used to send raw HTTP headers. See the HTTP / 1.1 specification for information on HTTP headers .

Answer 3, authority 90%

I usually use

header ("Location: http://www.example.com/");

Answer 4, authority 99%

  1. header ('Location: _URL_'); exit;
  2. echo '& lt; script & gt; location.replace ("_ URL _"); & lt; / script & gt;'; exit;

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions