0

So, i'm developing a form that will be checked by a program to be executed with the data. How do you dump the data into a .json file with html forms or any other language?

For sake of the project i'll give a section of the html form to help understand.

<form action="/folder/data.php" method="post">
  <div>
    <label for="firstname">First Name:</label>
    <input type="text" id="firstname" name="firstname">
  </div>
  <div class="button">
    <button type="submit">Sumbit!</button>
   </div>
</form>
Pius Lee
  • 25
  • 6

1 Answers1

0

In my (limited) experience, "action" in the links to a PHP file to process the submitted form fields, like so: Insert input data from HTML form into JSON object and then store it in MYSQL).

Basically, you'll be converting your input fields into a JSON object with 'json_encode' (for PHP) or something similar.

You may want to check out this question: How to send a JSON object using html form data

akelley
  • 16
  • 3