server.php: calculate value of base URI just once and store it
Add spinner animation for later use
Print a simple login form when basic auth fails

Nicer than just printing 'authentication required'. This login form uses
JavaScript to load the credentials into the browser's authentication
cache, thereby hopefully creating a basic auth session that keeps the
user logged in.