http://www.nationalautoliquidators.com/used_cars/mk-Acura/md-CL/st-Alaska/ct-Chefornak/
Say someone enters the site from an chevy silverado chefornak alaska and in my feed i do not have a chevy silverado in chefornak alaska so they come to a blank page.
Im thinking that i could put a loop inside a loop like run through the Database if 0 results return go back and increase the radius for 200 miles. I cant figure it out for the life of me, and then the mod-rewrite thing i get confused on what page im even on.
[php]<?php
include (“inc/config.php”) ;
$State = str_replace(array("_","-"),array(" ", " "),$_GET['State']);
$City = str_replace(array("_","-"),array(" "," "),$_GET['City']);
$Make = str_replace(array("_"),array(" "),$_GET['Make']);
$Model = str_replace(array("_"),array(" "),$_GET['Model']);
$dashState=str_replace(array(" "),array("_"),$State);
$dashCity=str_replace(array(" "),array("_"),$City);
$dashModel=str_replace(array(" "),array("_"),$Model);
$logoTag = 'Used Cars for Sale';
$metaTitle = 'Used '.$Make.' '.$Model.' for Sale in '.$City.', '.$State.'';
$metaDesc = ''.$Make.' '.$Model.' '.$City.' Find '.$Make.' '.$Model.' in '.$City.', '.$State.'';
$metaKeywords = ''.$Model.','.$Make.' '.$Model.', '.$City.'. '.$State.' used cars, buy, search, find, buying';
// Turn ads on or off
$ad160600 = ‘ON’; $ad180150 = ‘OFF’; $ad72890 = ‘ON’;
// Turn Sections on or off
$bigbox = ‘OFF’;
include ("inc/meta-head.php") ;
// Find a zip code for used cars
$zipQuery = "
SELECT zipZipCode
FROM Jess_City, ace_state, ace_city, ace_zip
WHERE Jess_City.city_name = ace_city.city_name
AND Jess_City.st_name = ace_state.st_name
AND city_id = zipCityID
AND st_id = zipStateID
AND Jess_City.st_name = ‘$State’
AND Jess_City.city_name = ‘$City’
ORDER BY Jess_City.count DESC
LIMIT 1;
;
";
42450
$zipRow = mysql_query($zipQuery);
$zipQ = mysql_fetch_assoc($zipRow);
$zipcode = $zipQ[“zipZipCode”];
// Used car feed info for LotPro.com
$make = $_POST[‘make’];
$model = $_POST[‘model’];
$price = $_POST[‘price’];
$radius = $_POST[‘radius’];
$showCars = $_POST[‘showCars’];
$sZip = $_POST[‘sZip’];
if($price==""){$price="99999";}
if($radius==""){$radius="100";}
if($showCars==""){$showCars = 16;}
if($make==""){$make="$Make";}
if($model==""){$model="$Model";}
if($sZip!=""){$fZip=$sZip;}else{$fZip="$zipcode";}
?>
	<?php if ($bigbox == 'ON') include ("inc/nav-headerbox.php") ;?>
	<div id="wrapper"><div class="wrapper-top-left"><div class="wrapper-top-right"><div class="wrapper-bottom-left"><div class="wrapper-bottom-right"><div class="width">
	<div id="right">
		<?php include ("inc/nav-menubox.php") ;?>
	</div>
	<div style="margin: 10px 0 10px 15px;">
	<h1><?php echo"".$Make." ".$Model." Model Years";?></h1>
| $YearC $MakeC $ModelC"; } // Put the code to end the current row here echo " | 
		<?php include ("ads/ad180150.php") ;?>
		<?php include ("ads/ad160600.php") ;?>
	<div class="module"><div class="first"><div class="sec"></div>
			<h3><span>Event Conditions</span></h3>
			<div class="box-indent">
				<div class="width">
					No Dealers Or Wholesalers Allowed.Until The Close Of Business On The Last Day Of The Liquidation Event.<br /><br />
					No Over Night Camping Permitted!<br /><br />
					Be Prepared To Take Immediate Delivery!y
				</div></div></div></div>
	<div class="module-banner2"></div></div>
	<div class="container">
	<div class="width2">
	<table class="blog" cellpadding="0" cellspacing="0">
		<tbody>
			<tr>
				<td valign="top"><div class="border-left"><div class="border-right"><div class="border-top"><div class="border-bottom"><div class="corner-top-left"><div class="corner-top-right"><div class="corner-bottom-left"><div class="corner-bottom-right"><div class="width"><div><div class="title-top"><div class="title-bottom"><div class="title-top-left"><div class="title-top-right"><div class="title-bottom-left"><div class="title-bottom-right"><div class="width">
				<table class="contentpaneopen">
					<tbody>
						<tr>
							<td class="contentheading" width="100%">
							<?php echo $City;?> Used <?php echo $Make;?> Cars For Sale</td>
						</tr>
					</tbody>
				</table></div></div></div></div></div></div></div>
	<div class="article-indent"><div class="width">
		<table class="contentpaneopen">
			<tbody>
				<tr>
					<td> </td>
				</tr>
				<tr>
					<td colspan="2" valign="top">
						<div class="bcrumb">
						<a href="<?php echo"$webPath";?>">Autos</a> >
						<a href="<?php echo"$webPath";?>used_cars/">Used Cars</a> >
						<a href="<?php echo"$webPath";?>used_cars/st_<?php echo"$dashState"?>/"><?php echo"$State" ;?></a> >
						<a href="<?php echo"$webPath";?>used_cars/s_<?php echo"$dashState"?>/ct_<?php echo"$dashCity" ;?>/"><?php echo"$City" ;?></a> >
						<a href="<?php echo"$webPath";?>used_cars/s-<?php echo"$dashState";?>/c-<?php echo"$dashCity";?>/m-<?php echo"$dashMake";?>/"><?php echo"$Make" ;?></a> >
						<?php echo"$Model" ;?>
						</div>
						<div>
						<?php include("feeds/filter.php");?>
						</div>
						</p>
					</td>
				</tr>
			</tbody>
		</table></div></div>
	<table class="blog" cellpadding="0" cellspacing="0">
		<tbody>
			<tr>
				<td valign="top"><div class="border-left"><div class="border-right"><div class="border-top"><div class="border-bottom"><div class="corner-top-left"><div class="corner-top-right"><div class="corner-bottom-left"><div class="corner-bottom-right"><div class="width"><div><div class="title-top"><div class="title-bottom"><div class="title-top-left"><div class="title-top-right"><div class="title-bottom-left"><div class="title-bottom-right"><div class="width">
				<table class="contentpaneopen">
					<tbody>
						<tr>
							<td class="contentheading" width="100%">
							Find a Used <?php echo $Make;?> <?php echo $Model;?> For Sale near <?php echo $City ;?></td>
						</tr>
					</tbody>
				</table></div></div></div></div></div></div></div>
	<div class="article-indent"><div class="width">
		<table class="contentpaneopen">
			<tbody>
				<tr>
					<td> </td>
				</tr>
				<tr>
					<td colspan="2" valign="top">
					<?php include("feeds/lastUpdated.php");?>
					<?php include("feeds/rss3html-filter.php");?>
					</td>
				</tr>
			</tbody>
		</table></div></div>
			<span class="article_separator"> </span>
			</div></div></div></div></div></div></div></div></div></div>
		</td>
	</tr>
	<tr>
		<td valign="top">
			<table cellpadding="0" cellspacing="0" width="100%">
				<tbody>
					<tr>
						<td class="article_column" valign="top" width="100%"><div class="border-left"><div class="border-right"><div class="border-top"><div class="border-bottom"><div class="corner-top-left"><div class="corner-top-right"><div class="corner-bottom-left"><div class="corner-bottom-right"><div class="width"><div class="title-top"><div class="title-bottom"><div class="title-top-left"><div class="title-top-right"><div class="title-bottom-left"><div class="title-bottom-right"><div class="width">
						<table class="contentpaneopen">
							<tbody>
							<tr>
								<td class="contentheading" width="100%">
									<?php echo $City;?> Used Cars for Sale By <?php echo $Make;?> Model
								</td>
							</tr>
							</tbody>
						</table></div></div></div></div></div></div></div>
		<div class="article-indent"><div class="width">
		<table class="contentpaneopen">
			<tbody>
				<tr>
					<td> </td>
				</tr>
				<tr>
					<td colspan="2" valign="top">
| $MakeC $ModelC"; } // Put the code to end the current row here echo " | 
	 </tbody>
		 </table><div></div>
		</td>
		</tr>
	</tbody>
	</table></div></div>
			</div></div></div></div></div></div></div></div></div></div>
		</td>
	</tr>
	<tr>
		<td valign="top">
			<table cellpadding="0" cellspacing="0" width="100%">
				<tbody>
					<tr>
						<td class="article_column" valign="top" width="100%"><div class="border-left"><div class="border-right"><div class="border-top"><div class="border-bottom"><div class="corner-top-left"><div class="corner-top-right"><div class="corner-bottom-left"><div class="corner-bottom-right"><div class="width"><div class="title-top"><div class="title-bottom"><div class="title-top-left"><div class="title-top-right"><div class="title-bottom-left"><div class="title-bottom-right"><div class="width">
						<table class="contentpaneopen">
							<tbody>
							<tr>
								<td class="contentheading" width="100%">
									Used <?php echo $Make;?> <?php echo $Model;?>s for Sale in Other <?php echo $State;?> Cities
								</td>
							</tr>
							</tbody>
						</table></div></div></div></div></div></div></div>
		<div class="article-indent"><div class="width">
		<table class="contentpaneopen">
			<tbody>
				<tr>
					<td> </td>
				</tr>
				<tr>
					<td colspan="2" valign="top">
| $CityA"; } // Put the code to end the current row here echo " | 
					</td>
				 </tr>
			 </tbody>
		 </table><div></div>
		</td>
		</tr>
	</tbody>
	</table></div></div>
	<span class="article_separator"> </span></div></div></div></div></div></div></div></div></div>
		</td>
		</tr>
		</tbody>
		</table>
		</td>
		</tr>
		</tbody>
	</table></div></div></div></div></div></div></div></div>
	</div>
	<span class="article_separator"> </span>
		<?php include ("ads/ad72890.php") ;?>
		<?php include ("inc/footer.php") ;?>
