Introduction to PHP Redirects

Using the header function, you can redirect the browser from one page to another. To do this, you need to pass the HTTP Location header in it:

index.php<?php
  header('Location: test.php');
?>

The target page address can also be stored in a variable:

index.php<?php
  $addr = 'test.php';
  header('Location: ' . $addr);
?>

Instead of concatenation, you can use variable interpolation:

index.php<?php
  $addr = 'test.php';
  header("Location: $addr");
?>
Задание 1

When visiting the page index.php, perform a redirect to the page page.php.