PHP 8
Beginner
Basics
· 1 min read
Redirect with header Location
How do I send the browser to another page?
header Location + exit.
Example
<?php
header('Location: /dashboard.php');
exit;
Line-by-Line Walkthrough
Call before any HTML output. Always exit after redirect.