include("includes/top.html");
?>
Compare Lawn Mowers
include("includes/header.html");
include("includes/connect.html");
?>
Compare Lawn Mowers
//* clean inputs to stop sql injection//
$type = ereg_replace("[^A-Za-z0-9]", "", $_GET['type']);
$brand = ereg_replace("[^A-Za-z0-9]", "", $_GET['brand']);
$year = ereg_replace("[^A-Za-z0-9]", "", $_GET['year']);
$mindeck = ereg_replace("[^A-Za-z0-9]", "", $_GET['mindeck']);
$maxdeck = ereg_replace("[^A-Za-z0-9]", "", $_GET['maxdeck']);
$minhorse = ereg_replace("[^A-Za-z0-9]", "", $_GET['minhorse']);
$maxhorse = ereg_replace("[^A-Za-z0-9]", "", $_GET['maxhorse']);
$decktype = ereg_replace("[^A-Za-z0-9]", "", $_GET['decktype']);
$mulch = ereg_replace("[^A-Za-z0-9]", "", $_GET['mulch']);
$bag = ereg_replace("[^A-Za-z0-9]", "", $_GET['bag']);
$side = ereg_replace("[^A-Za-z0-9]", "", $_GET['side']);
$order = ereg_replace("[^A-Za-z0-9]", "", $_GET['order']);
//* end clean inputs//
//* find current url//
function selfURL() { $s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : ""; $protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s; $port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]); return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI']; } function strleft($s1, $s2) { return substr($s1, 0, strpos($s1, $s2)); }
//* end find current url//
if(isset($type)){$type = "type='".$type."'";}else{$type="type='push'";}
if(strlen($brand)>="2"){$brand = " and brand='".$brand."'";}else{$brand="";}
if(strlen($year)>="2"){$year = " and year >= '".$year."'";}else{$year="";}
if($mindeck>"0"){$mindeck = " and deck >= '".$mindeck."'";}else{$mindeck="";}
if($maxdeck>"0"){$maxdeck = " and deck <= '".$maxdeck."'";}else{$maxdeck="";}
if($minhorse>"0"){$minhorse = " and horse >= '".$minhorse."'";}else{$minhorse="";}
if($maxhorse>"0"){$maxhorse = " and horse <= '".$maxhorse."'";}else{$maxhorse="";}
if(strlen($decktype)>="2"){$decktype = " and decktype='".$decktype."'";}else{$decktype="";}
if(strlen($mulch)>="2"){$mulch = " and mulch='".$mulch."'";}else{$mulch="";}
if(strlen($bag)>="2"){$bag = " and bag='".$bag."'";}else{$bag="";}
if(strlen($side)>="2"){$side = " and side='".$side."'";}else{$side="";}
if(strlen($order)>="2"){$order = " order by '".$order."'";}else{$order="";}
$result = mysql_query("SELECT * FROM mowers where ".$type.$brand.$year.$mindeck.$maxdeck.$minhorse.$maxhorse.$mulch.$bag.$side.$order."");
echo"
Pic |
Name |
Engine (hp/brand) |
Deck (size/type) |
";
while ( $row = mysql_fetch_array($result) )
{
$brandurl = str_replace(" ", "_", $row['brand']);
$pic="http://www.lawnmowerfacts.com/images/mowers/".$brandurl."/thumbs/".$row['model'].".jpg";
echo" | ";
echo"".$row['brand']." ".$row['name']."
| ".$row['horse']."hp ".$row['engine']." | ".$row['deck']."\" ".$row['decktype']." deck |
";
}
echo"
";
?>
Lawnmower Facts   |  
Privacy   |  
Add Your Link
All Right Reserved.