PHP Parsing/File Editing

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

rabidroach90

Thread Starter
Joined
Nov 15, 2006
Messages
10
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?
 
Joined
Nov 22, 2003
Messages
6,052
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);
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Top