Hi !
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.
$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); }
}
The problem is it prints the full list as many times as values are in $delete_users, with one deletation on each. What should I do to print only once the list with all the deletion at a time?
I understand why this happens but can“t find the way to correct the problem.