<?php
// This page defines two functions used by login/logout function.
/*This function determines an absolute URL, and redirects the user there.
*The function takes one argument, the to be redirected to.
*?the arguemnt defaults to index.php.
*/
function redirect_user ($page = "index.php") {
// Start defining the URL.
// URL is 'http:// ' . $_SERVER['HTTP_HOST'] . dirname ([$_SERVER['PHP_SELF']):
$url = 'http://' . $_SERVER['localhost'] . medicalcenter($_SERVER['PHP_SELF']);
// Remove the any trailing slashes;
$url = rtrim($url,'/\\');
// Add the page:
$url .= '/'. $page;