"Use that in your login header script, will send the person back to the last visited page"
Just to be clear:
$_SERVER['HTTP_REFERER']
... is a variable. It does nothing on its own so including anwhere on any page will producing nothing.
However, this variable can be used in conjunction with the function header() to redirect.
Examples:
To send to a specific page:
header('Location: http://path/to/page');
exit;
To dynamically send back to the page they came from (using the variable mentioned by Azala)
header('Location: '.$_SERVER['HTTP_REFERER']);
exit;
[INDENT]...that variable may not always be set, e.g. user got to the page by typing it in directly, so you may want to check for that as well:[/INDENT]
header('Location: '.(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : 'http://hard/coded/page'));
exit;
[/SIZE]
Note: If you're setting session variables on the page which includes the redirect make sure to call session_write_close() before calling the header function. e.g.:
session_write_close();
header('Location: '.$_SERVER['HTTP_REFERER']);
exit;
... could help save future headaches/rabbit chassing.
Hope that helps.