Reading data from a txt file for editing

Discussion in 'PHP' started by wvccboy, Jun 15, 2007.

  1. #1
    I've seen a few scripts with an admin panel that reads data off a .txt file and then gives you options to delete the set.

    However, they all are md5 encoded txt files, and mine is not.

    Is there a way to read a set of data from a txt file and create an option, and do you have an example?

    Right now I am able to read the data from the txt file using the readfile function, but now I want to edit the values the script is reading.

    Thanks!
     
    wvccboy, Jun 15, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Can you be more specific? An example of the txt file would be good, and what exactly you want to do.
     
    nico_swd, Jun 15, 2007 IP
  3. wvccboy

    wvccboy Notable Member

    Messages:
    2,632
    Likes Received:
    81
    Best Answers:
    1
    Trophy Points:
    250
    #3
    Ok.

    My script creates the values, and sends it to data.txt in this format:

    fwrite($out,"Family: $user<br />Item: $message<br /><b>Cost: $$cost</b><br />");

    That puts the correct data in the text file. The script has a function that splits all the values with
    The contents of the txt file would be then

    With my current "admin" panel, I can read all the data with the readfile function, but I have no idea how to edit the values I see, such as the family, item, cost, etc... that's what I'm looking for.

    Thanks
     
    wvccboy, Jun 15, 2007 IP