I’m a beginner web developer, and I’m coding a small project, mostly in order to learn the practice.
I am now writing an HTML page (with JavaScript) that collects data from users. The HTML page is pretty complicated and by the time a user had finished filling all the fields, not all the data is in the form – some of it was calculated by JavaScript and stored, either in localstorage or in attributes of certain HTML elements.
How can I submit the data into a MySQL database? (using methods with POST in PHP, like this one, only allows to send data that is in <input> tags)
you have to use ajax(Asychronous Javascript And Xml) to send data to the server or you can use jQuery to do it..
eg:
$.ajax({
type: "get",
url: some_php_script.php,
data: {"list": list_data},
success: function(data){
do some work here with the data recieved
}
});