Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: Editor Help!!!

  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Editor Help!!!

    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

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,549
    Thanks
    8
    Thanked 1,094 Times in 1,085 Posts
    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+...or&btnG=Search


    .

  • #3
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by mlseim View Post
    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+...or&btnG=Search


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

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,549
    Thanks
    8
    Thanked 1,094 Times in 1,085 Posts
    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.

  • #5
    New Coder
    Join Date
    Jan 2012
    Posts
    10
    Thanks
    0
    Thanked 1 Time in 1 Post
    Quote Originally Posted by Cyrix View Post
    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.

  • #6
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Kekke View Post
    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 You will be of GREAT!! help


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •