Location: PHPKode > scripts > Dynamic FreeDNS IP Address Update Client > dynamicfreedns_1_1/removal.php
<HTML>
<HEAD>
<TITLE>Dynamic FreeDNS IP Address Updater Results</TITLE></HEAD>
<BODY>
<H2>Dynamic FreeDNS IP Address Updater Domain and Update Code Results:</H2>

<?php

include "dbconnect.php";

if (!$_POST[deletedomain]) {

	echo "No domain name entered";
	?>
	<BR><BR><TABLE><TR><TD><A HREF="remove.php"STYLE="text-decoration:none">Go Back</A></TD></TR></TABLE>
	<?	
	exit;
	}
	
 if(!ereg("[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]", $_POST[deletedomain])) {

		echo "The domain name you entered is invalid.  Enter in the format: domain.tld \n\n";
	?><BR><BR>
	<TABLE><TR><TD><A HREF="remove.php"STYLE="text-decoration:none">Go Back</A></TD></TR></TABLE>
	<?	
exit;
	}
		  
$idnumber = "SELECT `domains`.`id` FROM `domains` WHERE `domains`.`domain` = '$_POST[deletedomain]';";
$result = mysql_query($idnumber);    
 
$resultstop = mysql_query("SELECT * FROM `domains` WHERE `domains`.`domain` = '$_POST[deletedomain]';")
or die(mysql_error());  

$row = mysql_fetch_array( $resultstop );

if (!$row['id']){ echo "Domain not found.\n\n"; ?><BR><BR><a href="results.php"STYLE="text-decoration:none"><? echo "Check to see if the domain exists in the database"; ?></a><? echo" and be sure to enter it in the format: domain.tld."; 

	?><BR><BR>
	<TABLE><TR><TD><A HREF="remove.php"STYLE="text-decoration:none">Go Back</A></TD></TR></TABLE>
	<?	
exit;
}

while ($record=mysql_fetch_assoc($result)) { 

        while (list($fieldname, $fieldvalue) = each ($record)) {

$deletecodes = "DELETE FROM `update` WHERE `update`.`id` = '$fieldvalue';";

mysql_query($deletecodes);

$delete = "DELETE FROM `domains` WHERE `domains`.`id` = '$fieldvalue';";

mysql_query($delete);

}
echo "<BR>";
}

echo "<BR><BR>".$_POST[deletedomain]." and the Update Codes Associated With it Have Been Removed <BR><BR>";
echo $_POST[deletedomain]." Will Not Be Updated by Dynamic FreeDNS if the Internet Protocol Address on This Machine Changes.<BR><BR>";


include "footer.php";
include "closedb.php";
?>
Return current item: Dynamic FreeDNS IP Address Update Client