here is a function from a program i made a while back that basically stores id numbers with corresponding link urls in a text file so you can call click.php?link=title and it will search the text file for title and redirect. in the admin section i have delete and edit options, this is delete, similar to what you want to do.
function deleteLink()
{
global $config;
$input = file($config[dataFile]);
//next part will iterate over all the entries in the array.
//it will explode them and check to see if the current link name matches the one POSTed for deletion.
//this is similar to what you will do, just check the username instead
//if the link name matches, it skips over it and then continues adding the other links into an array.
foreach($input as $line) {
$lineData = explode("|", $line);
if($lineData[0] == $_POST[linkName]) {
continue;
} else {
$return[] = $lineData[0] . "|" . $lineData[1];
}
}
//now that we have an array with everything except the one we want deleted,
//we can write them back to the file
//above this last step is where you will put code to handle if the user was approved or deleted,
//and do what you want to do with them
$fp = fopen($config[dataFile], "w+");
if(!$fp) {
echo "Couln't not open data file for writing.";
exit;
}
foreach($return as $oneLink) {
fwrite($fp, $oneLink);
}
echo "<center>Successfully deleted link $_POST[linkName] from list</center><br><br>\n\n";
fclose($fp);
}
hope that helps, i also have functions for edit if you need it.