Header Location Question

Is it possible to determine if there was a redirect without recording the session, etc.? Kind of like a POST request:

if(isset($_POST['post']))
{
  echo ' ';
}
else
{
  echo '  ';
}

Answer 1

You can try this:
index.php:

header('Location:test.php?ref=1');

test.php:

if ((isset($_GET['ref']) && ($_GET['ref']=='1')){
    echo 'Redirect from index.php';
} else {
    echo 'Without redirect';
}

If following a link, you can see the value of $_SERVER[‘HTTP_REFERER’].