$value) { if ( ($key != 'cookiename') and ($key != 'cookievalue') and ($key != 'url') ) { if (preg_match("/\?/", $urlfwd)) { $urlfwd .= '&'.$key.'='.$value; } else { $urlfwd .= '?'.$key.'='.$value; } } } if ($_POST[addrType]) { foreach ($_POST as $key => $value) { $value = preg_replace("/\s/", "%20", $value); $value = preg_replace("/\#/", "", $value); $urlfwd .= '&'.$key.'='.$value; } } /* if ($_POST[SelectedProductId]) { foreach ($_POST as $key => $value) { $value = preg_replace("/\s/", "%20", $value); $value = preg_replace("/\#/", "", $value); $urlfwd .= '&'.$key.'='.$value; } } if ($_POST[ServiceCatalogSel]) { foreach ($_POST as $key => $value) { $value = preg_replace("/\s/", "%20", $value); $value = preg_replace("/\#/", "", $value); $urlfwd .= '&'.$key.'='.$value; } } */ /* if ($_POST[rcnLobSelectedI]) { foreach ($_POST as $key => $value) { $value = preg_replace("/\s/", "%20", $value); $value = preg_replace("/\#/", "", $value); $urlfwd .= '&'.$key.'='.$value; } } if ($_POST[rcnLobSelectedC]) { foreach ($_POST as $key => $value) { $value = preg_replace("/\s/", "%20", $value); $value = preg_replace("/\#/", "", $value); $urlfwd .= '&'.$key.'='.$value; } } if ($_POST[rcnLobSelectedP]) { foreach ($_POST as $key => $value) { $value = preg_replace("/\s/", "%20", $value); $value = preg_replace("/\#/", "", $value); $urlfwd .= '&'.$key.'='.$value; } } */ if ($_POST[ServiceCatalogLob]) { foreach ($_POST as $key => $value) { $value = preg_replace("/\s/", "%20", $value); $value = preg_replace("/\#/", "", $value); $urlfwd .= '&'.$key.'='.$value; } } } if ($urlfwd != '') { Header("HTTP/1.1 301 Moved Permanently"); Header("Location: $urlfwd"); } else { Header("HTTP/1.1 301 Moved Permanently"); Header("Location: http://www.rcn.com"); } function setMarket($request_uri, $record) { if ($_SERVER['SERVER_NAME'] == 'dev.web.rcn.net') { $cookie_domain = '.rcn.net'; } else { $cookie_domain = '.rcn.com'; } $uri_array = preg_split("/\//", $request_uri); $market_array = array('boston', 'chicago', 'dc-metro', 'lehigh-valley', 'new-york', 'philadelphia','wilkes-barre'); foreach ($market_array as $item) { if ($uri_array[1] == $item) { setcookie('cookie_market', $item, time()+2592000, "/", $cookie_domain); // 30 day cookie $cookie_market = $item; } } // COOKIE CHECK if ($cookie_market == '') { $cookie_market = $_COOKIE['cookie_market']; } // GEO-IP CHECK if ( ($record->country_code == 'US') and ($cookie_market == '') ) { switch ($record->region) { case 'DC': // $cookie_market = 'dc-metro'; $ip_market = 'dc-metro'; break; case 'MD': // $cookie_market = 'dc-metro'; $ip_market = 'dc-metro'; break; case 'VA': // $cookie_market = 'dc-metro'; $ip_market = 'dc-metro'; break; case 'NY': // $cookie_market = 'new-york'; $ip_market = 'new-york'; break; case 'IL': // $cookie_market = 'chicago'; $ip_market = 'chicago'; break; case 'MA': // $cookie_market = 'boston'; $ip_market = 'boston'; break; case 'PA': if (preg_match("/^18/", $record->postal_code)) { // $cookie_market = 'lehigh-valley'; $ip_market = 'lehigh-valley'; } if (preg_match("/^18702/", $record->postal_code)) { // $cookie_market = 'lehigh-valley'; $ip_market = 'wilkes-barre'; } if (preg_match("/^19/", $record->postal_code)) { // $cookie_market = 'philadelphia'; $ip_market = 'philadelphia'; } break; } } /* if ($_SERVER['SERVER_NAME'] == 'dev.web.rcn.net') { $cookie_domain = '.rcn.net'; } else { $cookie_domain = '.rcn.com'; } // setcookie('cookie_market', $cookie_market, time()+2592000, "/", $cookie_domain); // 30 day cookie $market_array = array(); array_push($market_array, $cookie_market); array_push($market_array, $ip_market); return $market_array; */ }