 |
Версия для печати
Карта сайта
|
 |
Добро пожаловать в книгу отзывов и предложений!
Смотреть книгу
Оставить сообщение
ion));
fclose($newfile);
// remove slashes
$content=stripslashes($content);
// divide into entries
$lines = explode("%",$content);
// reset new entry counter
$count=0;
// loop over entries
while(list($key)= each ($lines)){
// when the entry is not the one to be deleted...
if ($key != $del){
// when it's not the first entry, don't add a % (prevents blank entry)
if ($key != 0){$newdatas .= "%";}
// divide into data chunks
$user = explode("#",$lines[$key]);
// add new counter and add the data
if ($key != 0){$newdatas .= $count."#".$user[1]."#".$user[2]."#".$user[3]."#".$user[4]."#".$user[5];}
// increase counter
$count++;
}
}
// replace old data file
$newfile = fopen($filelocation,"w+");
fwrite($newfile, $newdatas);
fclose($newfile);
echo "The entry has been deleted ";
}
}
?>
|
 |