8) $page_base = substr($url, 0, $slash_position+1); // "$slash_position+1" to include the "/". else { $page_base = $url; // $url is already the page base, without modification. if($slash_position!=strlen($url)) $page_base=$page_base."/"; } # If the page base ends with a \\, replace with a \ $last_two_characters = substr($page_base, strlen($page_base)-2, 2); if($last_two_characters=="//") $page_base = substr($page_base, 0, strlen($page_base)-1); return $page_base; } /*********************************************************************** get_base_domain_address($page_base) ------------------------------------------------------------- DESCRIPTION: Note that the base DOMAIN address is different than the base PAGE address. The base page address may indicate a directory structure, while the base domain address is simply the domain, without any files or directories. The base domain address found by taking everything to the right of the first "/" once past the initial "/"'s found after the protocol specifier (http:// or https://) INPUTS: $page_base, (from get_base_page_address) RETURNS: The base page domain address for URL ***********************************************************************/ function get_base_domain_address($page_base) { for ($pointer=8; $pointer