Page 1 of 1

Viewing and editting a text file

Posted: Wed Feb 25, 2009 4:53 pm
by chris-ramsey
Hi all.

I have gotone final thing that my website requires for a college project. I have been putting it off for a while and concentrating on everything else which I can do!

I have searched the internet endlessly for code and I just keep coming across code which doesnt work/doesnt make sense. :banghead:

I was wondering if someone here would be able to help me? I am looking to be able to open up a new pae from within the webiste. This page needs to display a txt box with the contents of a text file which will be saved in the same directory as the website. The text file is called, IP_Log.txt. The user must then be able to edit the contents of the text file and then click a button which will save the contents and overwrite the file.

Thank you in advance to anyone that can help me. This forum has been very helpful before!

Re: Viewing and editting a text file

Posted: Wed Feb 25, 2009 5:09 pm
by jayshields
I'm surprised you haven't found good examples on the 'net, although it's very simple to do yourself. You'll need fopen(), fread() and fwrite(). You could've found those functions pretty easily by just searching the PHP manual.

Re: Viewing and editting a text file

Posted: Thu Feb 26, 2009 11:56 am
by tom456