Hey. i was wondering howto delete a single line from a FFD
on the server that i currently have, it is not possible to use a mySQL database and I'd rather keep it a FDD
I have tried too no avail.
Here is my current code
<?php
$file = fopen('clients.txt','r');
$id = $_REQUEST['id'];
for ($i=0; $i<count($file); $i++)
{
list ($field1, $field2, $field3, $field4) = split ('\|', $i);
if ($field1!=$id)
{
$data .= $field1.'|'.$field2.'|'.$field3.'|'.$field4."\n";
}
}
fclose($file);
$fp = fopen('clients.txt','w');
fwrite($fp,$data);
fclose($fp);
?>
and my friend suggested putting it all in a table, and deleting the line, and overwriting the file.
no idea of how to do this....
Oh, my database is kinda like this.
23453|maxicube|admin|305
23454|fish|user|28
Also, if i run that.
this is all that returns on clients.txt
0|||
thanks for your help - Maxicube :D