header php
snippet in php

php header location

user3541

<?php
// This will just redirect you to example.com
header("Location: https://example.com");  
?>

header location in php

user2438

<?php
// This will redirect  to google.com
$url = "https://google.com";
header("Location: $url");  
?>

php redirect

user9025

header("Location: http://example.com/myOtherPage.php");
die();

header php location

user1829

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

header location php

user2860

<?php
// This will just redirect you to example.com
$url = "https://example.com";
header("Location: $url");  
?>

header php

user9149


<html>
<?php
/* This will give an error. Note the output
 * above, which is before the header() call */
header('Location: http://www.example.com/');
exit;
?>