I'm trying to work on a file where I store data about my e-mail subscribers (e-mail, IP and registration date). Now with checkboxes in a form I want to select some of them to be deleted.
I get an array with their info(e-mail address) in $delete_users, and I'm using this script.
Code: Select all
<?
$delete_users = $_POST['$delete_users'];
$file = $fullpath."my_list.php";
$filedat = file($file);
while(list(,$v) = each($delete_users)) {
foreach($filedat as $value){
list($e_mail,$_ip,$reg_date) = explode("|",$value);
if ($e_mail!=$v){
$data = "$e_mail|$_ip|$reg_date|\n";}
else $data = "";
$fp = fopen($file,"w");
fputs($fp,$data);
fclose($fp); }
}
?>I understand why this happens but can´t find the way to make it work correctly.