";
$localPathStart = (strpos($pageURL, "localhost") + 9);
$localPathEnd = (strrpos($pageURL, "/")) + 1;
$localPathLength = $localPathEnd - $localPathStart;
// echo $pageURL."
";
// Addresses are either:
// (http://)localhost/smcd/emb/aerosols/dddd.php
// or
// (http://)www.star.nesdis.noaa.gov/xxxxxxxx/yyy/zzz/qqqq.php"
if (strpos($pageURL, "localhost") !== false) {
// that is, if page is being viewed from the local sandbox webserver
$globalPath = 'c:\\websites\\www\\star\\global\\includes\\';
$localPath = 'c:\\websites\\'.substr($pageURL, $localPathStart, $localPathLength);
}
else {
if (strpos($pageURL, "www") !== false) {
// that is, if page is being viewed on one of the many STAR webservers
$globalPath = '/www/star/global/includes/';
$firstSlash = (strpos($pageURL, "/"));
$lastSlash = (strrpos($pageURL, "/"));
$localPathSize = $lastSlash - $firstSlash + 1;
$localPath = "/www".(substr($pageURL,$firstSlash,$localPathSize));
}
}
?>