This books is very well thought-out. Love the book.
There's this challenge for me: I, too, can not figure out why this does not work. I'm on hmm. 3 hours ish 4 hours ish? On this.
:'( I tried searching for white space and have not been successful.
function redirect_user ($page = 'loggedin.php')
{
$url = 'http://' . $_SERVER['localhost'] . dirname($_SERVER['htdocs']);
$url = rtrim($url, '/\\');
$url .= '/' . $page;
// Redirect the user:
header("Location: $url");
exit(); // Quit the script.
}