Skip to content
PHP Logo

What are some alternative functions in PHP to link to another page besides using include?

When you want to link to another page in PHP without using the include function, you can use the header function to redirect the user to a different URL. This is commonly used for redirecting users after form submissions or when a certain condition is met.

php
<?php
// Redirect to another page
header("Location: http://www.example.com/anotherpage.php");
exit;
?>