php if isset _SERVER HTTP_REFERER strpos _SERVER HTTP_SERVER _SERVER H

1
2
3
4
5
6
7
<?php
if (isset($_SERVER['HTTP_REFERER']) &&
strpos($_SERVER['HTTP_SERVER'], $_SERVER['HTTP_REFERER']) !== false) {
$redir = $_SERVER['HTTP_REFERER'];
} else {
$redir = '/';
}