<?PHP

include("config.php");

if (!$_POST){ header('Location: '.$site_url); }

$sql = "DELETE FROM ".$prefix.$main_table." WHERE ".$field_lead."id = ".$_POST[$field_lead.'id'];

//echo $sql;

mysql_query($sql) or die(mysql_error());

$sql = "DELETE FROM ".$prefix.$main_table."Edits WHERE ".$field_lead."id_fk = ".$_POST[$field_lead.'id'];

//echo $sql;

mysql_query($sql) or die(mysql_error());

$sql = "DELETE FROM ".$prefix.$main_table."Editors WHERE ".$field_lead."id_fk = ".$_POST[$field_lead.'id'];

//echo $sql;

mysql_query($sql) or die(mysql_error());

//$sql = "DELETE FROM ".$prefix.$main_table."Comment WHERE openwater_id_fk = '$_POST[openwater_id]'";
//mysql_query($sql) or die(mysql_error());

//$sql = "DELETE FROM gforum_OpenWaterRating WHERE openwater_id_fk = '$_POST[openwater_id]'";
//mysql_query($sql) or die(mysql_error());

header('Location: '.$site_url);

?>