...

View Full Version : Editor Help!!!



Cyrix
01-13-2012, 03:17 AM
Ok so I have a file directory viewer so when you click a file it opens in a text area(my editor) Now its editable but I need a save button. Please help!!! Here is my code http://pastie.org/3176030

mlseim
01-13-2012, 03:21 PM
You put that textarea into a <form ... > and the action is another PHP script to
process the form and re-save the changes. There is an issue with that though ...
will the text be plain-text, or rich-text (with formatting)? And what about any HTML?

Processing text (as in making your own text editor) can be tricky, especially for
validation and security. Allowing anyone to edit text needs special attention.

Your post is going to be hard to answer, and probably even tougher to provide
actual scripting. You may even wish to use an AJAX approach to editing online.
That adds a whole new twist to your project.

This may be a good place to start:
https://www.google.com/search?q=php+ajax+online+text+editor&btnG=Search


.

Cyrix
01-13-2012, 07:02 PM
You put that textarea into a <form ... > and the action is another PHP script to
process the form and re-save the changes. There is an issue with that though ...
will the text be plain-text, or rich-text (with formatting)? And what about any HTML?

Processing text (as in making your own text editor) can be tricky, especially for
validation and security. Allowing anyone to edit text needs special attention.

Your post is going to be hard to answer, and probably even tougher to provide
actual scripting. You may even wish to use an AJAX approach to editing online.
That adds a whole new twist to your project.

This may be a good place to start:
https://www.google.com/search?q=php+ajax+online+text+editor&btnG=Search


.

Well it is for a shell. It is to edit files within a directory. How would I go about saving this?

mlseim
01-13-2012, 07:21 PM
That one is beyond my abilities.
I'm guessing it gets into some server stuff, programming like C++ or something.
But, I really don't have experience at that level.

Kekke
01-13-2012, 07:41 PM
Well it is for a shell. It is to edit files within a directory. How would I go about saving this?

First of all, add a submit-button to your form (add the <textarea> into a form) then retrieve the $_POST['your_textarea']-data from the $_POST var.

Once you have what was posted, just open the file for writing and write the $_POST['your_textarea'] variable to the file.

It's as simple as that.

If you managed to write that script, you should be managed to complete it with this help.

Cyrix
01-13-2012, 09:08 PM
First of all, add a submit-button to your form (add the <textarea> into a form) then retrieve the $_POST['your_textarea']-data from the $_POST var.

Once you have what was posted, just open the file for writing and write the $_POST['your_textarea'] variable to the file.

It's as simple as that.

If you managed to write that script, you should be managed to complete it with this help.

Please provide the code :D You will be of GREAT!! help



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum