PHP file editor
- Started
- Last post
- 16 Responses
- atomica
Hey, I'm sorta new to PHP, got some basic understanding down, but what I need to do is make an editing page that lets the viewer open up a text file or xml file in a textarea and make changes to it, then write to the file when its done. I've seen it done before, in a round about or complex way, and figured maybe one of you skilled chaps could give a fellow a hand. Thanks for any help in advance.
- ikbenvanrijn0
you mean you want some source code that runs server based or an application that runs on your comp to edit the files?
- unfittoprint0
It's not an easy way for a beginner, but it's for the developer it's the right choice:
#install the apache server [over windows for example]
#install php
#install MySQL
each come with an instaltion guide.
Then use Dreamweaver to test locally your php sites.
- atomica0
source code that runs server based, that will open and display a file in a textarea via the website, and allow changes to be made to the file.
- atomica0
I'm guessing i phrased the question wrong. I'm already ahead of that unfit. :P
- atomica0
I want a php script that creates a textarea filled with a text or xml file, that allows the viewer to make changes to the file. :)
- unfittoprint0
jesus, I have to start to read the post til the end__________
anyway, you can use the fopen, fclose builtin function to open the txt / xml files. Make a variable to hold that value/string.
Then just print its content into the textarea.
- atomica0
Thanks, this should get me off on the right foot I hope.
- unfittoprint0
there are various ways to create a new file, write data on it using PHP.
Most of the file handlers exist here [maybe fflush].
- unfittoprint0
u could also check the code of some of this scripts:
http://paggard.com/projects/txt.…
- quik0
or you could use google...
:-)type : php.net/function_name for its reference and usage notes.
good luck.
- atomica0
I did google a bunch. I'm not much of a developer/programmer, so this is like throwing my head against a brick wall.... but i'm tryin.
- mike0
http://us2.php.net/manual/en/fun…
http://us2.php.net/manual/en/fun…
http://us2.php.net/manual/en/fun…should get you started... and I recently put together a simple doc for installing the WAMP platform...
http://www.blather.org/misc/WAMP…
have fun.
- unfittoprint0
thanks mike.
I was desperatly looking for server path assignment example.
This mean that I don't have to test my sites on Apache's htdocs folder?
- mike0
yeah- this install type makes it more or less identical to a typical *nix-based server environment for all common uses.
- unfittoprint0
great. thx.
- crkaintaiwan0
I'm trying to do the same thing but would like to use a form for the user to fill in. And maybe an image upload, to create a bio / profile. The info would then be printed into a template. Anybody have experience doing this? share some ideas or advice?