" . $_POST["uid"] . ""; $curPath = $_POST["curPath"]; $done = false; $foundIt = false; $fh = fopen($data, "r"); $alldata = ""; $count = 0; $buffer1 = ""; $buffer2 = ""; while ($newData = fscanf($fh, "%[^\n]")) { for ($i = 0; $i < sizeof($newData); $i++) { if (substr_count($newData[$i], $uid) > 0) { $foundIt = true; $count = 0; $loc = strrpos($allData, ""); $allData = substr($allData, 0, $loc) . "\n"; $loc = strrpos($allData, "\r"); $allData = substr($allData, 0, $loc) . "\n"; } if ($foundIt && (!$done)) { if (substr_count($newData[$i], "") > 0) { $count++; } else if((!$done) && substr_count($newData[$i], "") > 0 | substr_count($newData[$i], "") > 0) { if ($count == 0) { $done = true; } $count--; } } else { $allData .= $newData[$i]; } } } fclose($fh); $allData = str_replace("\r", "\n", $allData);//have to replace all newline things with \ns, then //replace those with \r\ns or it won't work on a windows system $fh = fopen($data, 'wb'); $newData = explode("\n", $allData); for ($i = 0; $i < sizeof($newData); $i++) { fwrite($fh, $newData[$i] . "\r\n"); } fclose($fh); global $deleteText; echo $deleteText; echo ""; } else { echo "Please do not access this page with scripts. "; } ?>