![]() |
Editing a .txt file Online & Reading
I'm looking for a simple way to have access to a .txt file online. I want to have a Text File in a folder on my FTP. Then open a HTML/PHP page & it will show me the contents of the file in ASCII format & give me the option to edit Text & Save the file (ie update the file in FTP).
Say file had Numbers, I could open a page, edit numbers & then save it. I have a PHP script that posts from a FORM to Text File, but on page load the Form is empty (ie it does not Read the Text File). Any free scripts that do this? Cheers |
Re: Editing a .txt file Online & Reading
Gimme a min and I'll write a script for you...
---------- Post added at 19:33 ---------- Previous post was at 18:52 ---------- Here ya go. Simple create the text file, modify the script to reflect the new filename, change the permissions so the webserver can read and write to it and you're done. If you're not sure on the permissions thing, set it to 777 (all can read/write) - this should give the correct permissions to the file. If you have shell access, do something like: Code:
chown nobody:nobody textfile.txtCode:
ps aux | grep httpdCode:
ps aux | grep apachePHP Code:
|
Re: Editing a .txt file Online & Reading
Simply AMAZING :D It's PERFECT :)
Cheers |
Re: Editing a .txt file Online & Reading
PHP Code:
PHP Code:
may correct that, I haven't tested it so my syntax might be wrong, I'm a bit out of practice :p: |
Re: Editing a .txt file Online & Reading
There are other options on the web for example
http://phpanywhere.net/ Although designed for php files it should work with any text based file |
Re: Editing a .txt file Online & Reading
Quote:
You're most welcome Jedi. |
Re: Editing a .txt file Online & Reading
It definitely would work, I'm just being picky ;)
|
Re: Editing a .txt file Online & Reading
Better to use file_get_contents() too, then you don't need to guess at the maximum size of the file.
|
Re: Editing a .txt file Online & Reading
Quote:
|
Re: Editing a .txt file Online & Reading
I have also used this script for a friend to update a news area written in flash to read dynamic text on her website easily.
The script is excellent and when uploaded and tested it works great, but after a short period of time the txt file address needs typing into address bar, hit f5 and then the news area updates, but updates instantly when files are uploaded. Any ideas? |
Re: Editing a .txt file Online & Reading
It's probably the browser caching the text file, is the Flash animation using an Iframe sort of thing?
|
Re: Editing a .txt file Online & Reading
I don't know what Iframe is, but I think you're right about caching, just what to do without having to refresh the text file.
|
Re: Editing a .txt file Online & Reading
thanks for sharing this
|
| All times are GMT +1. The time now is 22:28. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum