PHP 8 Beginner Basics · 1 min read

Redirect with header Location

Start the PHP 8 learning path »

❮ PHP 8 Home All Tutorials ❯

How do I send the browser to another page?

header Location + exit.

Example

PHP 8 Example
<?php
header('Location: /dashboard.php');
exit;

Line-by-Line Walkthrough

Call before any HTML output. Always exit after redirect.

Need more coins?

You do not have enough coins for this action.

Your balance: 0 coins

Share

Reactions

Loading reactions…