Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6148989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:22:38+00:00 2026-05-23T19:22:38+00:00

I am making a small web app that allows users to submit html, css

  • 0

I am making a small web app that allows users to submit html, css and javascript content via Ace Editor. In this editor, echoing stored content into the editor is simply enough however I cannot find anyway to submit a users input to the database. I can see there is a textarea generated by the JavaScript however I’m not exactly sure what it is doing, how to get to it or if I should be looking for something else entirely.

I’m primarily looking for a field or something that I can use to have php submit into the db.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T19:22:40+00:00Added an answer on May 23, 2026 at 7:22 pm

    The contents of the edit window are available with the session getValue method. For example, here is an extension to the standard ACE demo for save file:

    saveFile = function() {
        var contents = env.editor.getSession().getValue();
    
        $.post("write.php", 
                {contents: contents },
                function() {
                        // add error checking
                        alert('successful save');
                }
        );
    };
    

    I added the saveFile call to the already existing “Fake Save” that is in demo.js. I replace the alert with code like this:

    // Fake-Save, works from the editor and the command line.
    canon.addCommand({
        name: "save",
        bindKey: {
            win: "Ctrl-S",
            mac: "Command-S",
            sender: "editor|cli"
        },
        exec: function() {
            saveFile();
        }
    });
    

    The php file is just one line:

    $r = file_put_contents("foo.txt", $_POST["contents"]) or die("can't open file");

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rails CMS app that manages content for a production web server
For a small web app I'm making, I need to output sinusoidal test tones
I'm making a small application that is supposed to download info from the web
I'm making a small web application in Seaside. I have a login component, and
I am thinking of making an (initially) small Web Application, which would eventually have
I'm making a small tool application that user can minimize in the taskbar .
I am making some small business intelligence applications/tools that need to talk to other
I have made small web-app in jsp with a start page with login and
I'm making small web service(1) and I decided to use resteasy to make it.
I'm creating a small application on an embedded device that has a boa web

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.