Forum Moderators: coopster

Message Too Old, No Replies

Flat Filing

Flat Files (Edit, Update)

         

Hardbyte

11:14 am on Jul 19, 2004 (gmt 0)

10+ Year Member



Hi-ya,

I have a flat file (.dat or .txt) and I can read the whole contents from it and display it in a table in HTML.

What I would like to do, is kinda have an admin page, so after logging in, I can view this file and edit/modify the contents and save it back to the server where it is then needed via another page to just list the contents again. This way I dont have to edit the file using FTP, just like a bit of an admin page thingy just to update the contents.

Any1 point me in the right direction? Spent many hours trying all scripts and editing scripts to suit but just not happening.

Thanks

coopster

11:57 am on Jul 19, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, Hardbyte!

Why not read the file into a variable and use a <textarea> form element? Or is it more complex than that?

Hardbyte

2:29 pm on Jul 19, 2004 (gmt 0)

10+ Year Member



Hi-ya, thanks for your reply.

I kinda understand what you mean (im new to this) but I dont know how to read it into a textarea. I only really know how to display the contents of the file on a table.

?

Ta

coopster

2:46 pm on Jul 19, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Pretty simple really. You already have your file in that variable you described earlier and you are displaying it in an html table, now create an html form with a textarea element in it and write the variable out there instead. Make sense?