3 ms·
Starting with 2: an HTML form specifies a URL in the action property. When the form is submitted, the browser POSTs the field values to that URL. This means yo
by thinkling 13y ago
Starting with 2: an HTML form specifies a URL in the action property. When the form is submitted, the browser POSTs the field values to that URL.
This means you need a web server set up to handle POSTs to some URL with a script that will save the data into your DB. One very common way to do this is to run Apache as your web server and have it run a PHP script to massage the data & store it in a MySQL DB. Apache + MySQL + PHP = the AMP part of LAMP/MAMP/etc.
I'm sure you can find quick & dirty PHP example scripts to do this kind of thing. However, if you plan to put this out on the web at some point, you need to worry about all kinds of data integrity and security issues. In that case you're better off adopting some framework that will do all that work for you.
Before heading in that direction, I would research whether your needs are simple enough that you could use a no-SQL DB and have your browser-side JS post the form data as a json array straight into something like MongoDB.
All depends what you're trying to do in the long run, of course...