2 ) $PC_CUR_PAGE = $matches[2]; $PHP_SELF = '/states/state_places.php'; $phpself = substr($PHP_SELF, 1); include $phpself; } elseif ( preg_match('/^counties\/([^\/]+)\/$/i', $param, $matches) ) { // county home page require_once "classes/counties.class"; $countyid = counties::search($stateid, str_replace('_', ' ', $matches[1])); $PHP_SELF = '/counties/county_info.php'; $phpself = substr($PHP_SELF, 1); include $phpself; } elseif ( preg_match('/^counties\/([^\/]+)\/quickfacts.html$/i', $param, $matches) ) { // county quickfacts require_once "classes/counties.class"; $countyid = counties::search($stateid, str_replace('_', ' ', $matches[1])); $PHP_SELF = '/counties/county_quickfacts.php'; $phpself = substr($PHP_SELF, 1); include $phpself; } elseif ( preg_match('/^counties\/([^\/]+)\/K12-education.html$/i', $param, $matches) ) { // county education agency require_once "classes/counties.class"; $countyid = counties::search($stateid, str_replace('_', ' ', $matches[1])); $PHP_SELF = '/counties/county_education_agency.php'; $phpself = substr($PHP_SELF, 1); include $phpself; } elseif ( preg_match('/^counties\/([^\/]+)\/places[\/]?$/i', $param, $matches) ) { // county places require_once "classes/counties.class"; $countyid = counties::search($stateid, str_replace('_', ' ', $matches[1])); $PHP_SELF = '/counties/county_features.php'; $phpself = substr($PHP_SELF, 1); include $phpself; } elseif ( preg_match('/^counties\/([^\/]+)\/places\/([^\/\;]+).html$/i', $param, $matches) ) { // county places - by type require_once "classes/counties.class"; $countyid = counties::search($stateid, str_replace('_', ' ', $matches[1])); $type = $matches[2]; $PHP_SELF = '/counties/county_features.php'; $phpself = substr($PHP_SELF, 1); include $phpself; } elseif ( preg_match('/^city\/([^\/\;]+)[\;]([0-9]+)[\/]?$/i', $param, $matches) ) { // city info $cityid = $matches[2]; $PHP_SELF = '/cities/city_info.php'; $phpself = substr($PHP_SELF, 1); include $phpself; } elseif ( preg_match('/^city\/([^\/\;]+)[\;]([0-9]+)\/(airports|areacode_zip|jobs|real_estate|news|hotels|movies|hospitals|schools|colleges|libraries|nearby_cities|weather_forecast|weather_records|maps|contractors).html$/i', $param, $matches) ) { // city pages // page specific parameters passed through URL switch ($matches[3]) { case "airports": case "colleges": case "nearby_cities": $radius = $_GET["radius"]; $unit = $_GET["unit"]; break; case "hotels": $sortby = $_GET["sortby"]; break; } $cityid = $matches[2]; $PHP_SELF = '/cities/' . strtolower($matches[3]) . '.php'; $phpself = substr($PHP_SELF, 1); include $phpself; } elseif ( preg_match('/^city\/([^\/\;]+)[\;]([0-9]+)\/business[\/]?$/i', $param, $matches) ) { // city business home $cityid = $matches[2]; $PHP_SELF = '/cities/buz.php'; $phpself = substr($PHP_SELF, 1); include $phpself; } elseif ( preg_match('/^city\/([^\/\;]+)[\;]([0-9]+)\/business\/([^\/\;]+)[\;]([0-9]+)(\;([0-9]+))?.html$/i', $param, $matches) ) { // city business, by type $cityid = $matches[2]; $cur_cat = $matches[4]; if ( sizeof($matches) > 6 ) $PC_CUR_PAGE = $matches[6]; $PHP_SELF = '/cities/buz.php'; $phpself = substr($PHP_SELF, 1); include $phpself; } else { header("HTTP/1.1 404 Not Found"); exit(); } ?>