Tech Support Guy banner
Status
Not open for further replies.
1 - 2 of 2 Posts

·
Registered
Joined
·
10 Posts
Discussion Starter · #1 ·
Hello,

So, I have this website (whoa, who would have guessed). There's a section where people can sign up for events, etc. Upon hitting the submit button on this form, the data is stored into a flat file database (a simple txt file) and is spat back out at the user in tabular form by parsing the text file.

My problem, then, is this: I need an efficient way to remove entries from the list. The way I'm doing it right now is through a php in-browser text-editor, but this gets really confusing for those who I work with who aren't as computer savvy. I'm looking essentially for a way for someone to very easily just check off the people that need to be removed from the list, and hit submit.

EDIT: This may be simpler: Is there a way utilizing PHP to tell a text file to delete line X?

Any thoughts?
 

·
Registered
Joined
·
6,052 Posts
I don't know if you can delete by line number, but one way (granted, its a bit unreliable) is to tell it to replace the text of that line with "". For instance if the entry is 'John Smith' and there will be a line that says $name1 = "John Smith";, you could use something like this:

str_replace("\$name1 = \"John Smith\";", "", $file);
 
1 - 2 of 2 Posts
Status
Not open for further replies.
Top