<%>PHP<% > $pageUR1 = ereg_replace("/(.+)", "", $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]); $pageUR1 = preg_replace('{/$}', '', $pageUR1); //echo "pageUR1: ".$pageUR1."
"; $currentdomain = str_replace("www.", ".", $pageUR1); //echo "currentdomain: ".$currentdomain."
"; $isThereAPeriod = $currentdomain{0}; //echo "is there a period ? *".$currentdomain{0}."*
"; $makesure = substr($currentdomain, 1); //echo "makesure: ".$makesure."
"; if ($isThereAPeriod == ".") $currentdomain = $makesure; $s = explode(".",$currentdomain,2); $name = $s[0]; //echo "full name: ".$name."
"; $name = substr($name, 0); //echo "name: ".$name."
"; $extension = $s[1]; //echo "extension: ".$extension."
"; ?>