"; } //echo "name = $listingName and ID = $tempListingID"; if ($listingID > 0) { $listingTitle = getListingTitle($listingID); $strTitle = "Boston Condo - " . $listingTitle; } else { if (strlen($tempListingID)) { $listingID = $tempListingID; $listingTitle = getListingTitle($listingID); $strTitle = "Boston Condo - " . $listingTitle; } } */ // echo " the listing id = $listingID"; $listingShortTitle = ""; // !!! const warning if ( (strlen($nListingID) < 5) && (intval($nListingID) > 0) && (intval($nListingID) < 9000)) { $listingShortTitle = getListingShortTitle($nListingID); if (strlen($listingShortTitle) > 1) { $strNewPage = $config['baseurl'] . "/"; $strNewPage .= $listingShortTitle; $strNewPage = str_replace(" ","-", $strNewPage); //echo "$strNewPage"; header("Status: 301 Moved Permanently"); header ('Location: ' . $strNewPage); //header ('Location: '.$strNewPage); //header ('HTTP/1.0 301 Moved Permanently'); die; // Don't send any more output. } } $strContent =""; $file = "listingview.htm"; $file .= "_"; $file .= $nListingID; //$bNeedToCacheIt = TRUE; // check for the cache first. $nCache = file_exists("c9234570/$file"); //echo "file = $nCache"; //exit; if ($nCache !== FALSE) { // make sure its not the "not found page" if (filesize("/home/bostonc/public_html/c9234570/$file") > 1700) { // scale to minutes. $Diff = (time() - filectime("c9234570/$file"))/60; //echo "the diff = $Diff"; //exit; // If it changed in the last 120 minutes use the cache. if ($Diff < 2) { //echo "the diff = $Diff"; //exit; readfile("c9234570/$file"); // $bNeedToCacheIt = FALSE; exit(); } } } $strURL = 'http://www.boston-condo.com'; //$strURL = "http://host.averyst.com/~bostonc"; $strURL .= "/listingview_real.htm?listingID="; $strURL .= $nListingID; $strContent = file_get_contents ($strURL); // Write the cache. if (!$handle = fopen("c9234570/$file", 'w')) { echo "Cannot open file ($file)"; exit; } // Write $somecontent to our opened file. if (fwrite($handle, $strContent) === FALSE) { echo "Cannot write to file ($file)"; exit; } echo "$strContent"; ?>