echo stripslashes($_POST[name]); ?>
// check the db for similar matches
$name_tag = strtolower(str_replace(" ","", $_POST['name']));
$name_superstart = substr($name_tag, 0, 4);
$name_superend = substr($name_tag, -4, 4);
$name_supermid = substr($name_tag, ((strlen($name_tag))/2 - 2), 4);
//echo $name_supermid;
$match_sql = "SELECT fitter_id, fitter_name, fitter_name_tag, fitter_city, fitter_state FROM ".$prefix."Fitters WHERE fitter_valid = 1 AND (fitter_name_tag LIKE '%".$name_superstart."%' OR fitter_name_tag LIKE '%".$name_superend."%' OR fitter_name_tag LIKE '%".$name_supermid."%')";
//echo $match_sql;
$match_fetch = mysql_query($match_sql) OR die(mysql_error());
$i = false;
while ($match_row = mysql_fetch_array($match_fetch)) {
similar_text($match_row['fitter_name'], $_POST['name'], $percent);
if ($percent >= 50) {
if ($i == false) {
echo ("
Duplicate Alert:");
}
echo ("
".$match_row['fitter_name']." (".$match_row['fitter_city'].", ".$match_row['fitter_state'].") (Similarity: ".(round($percent, 0))."%)");
$i = true;
}
}
?>