setheader location history back javascript code example Example: php previous site header('Location: ' . $_SERVER['HTTP_REFERER']);