Relative Content

Tag Archive for javascriptphphtmlformsmysqli

I need to use a mysqli query that is created in js

I have to do my final degree project and I have a big problem in here, I’ve been dealing with it for about 2 weeks straight and came across with nothing.
The thing is, I need to create a survey webpage, and one of the elements I need to have is a page in which I can create the surveys to add them in the mysqli database (I’m using XAMPP), so I decided to create a structure based on a textbox, wehre the question will be, a select dropdown with the different types of questions (text, check, radius or select), and if we choose any of the ones which have different options when being answered (check, radius or select), a textbox will appear with a button. In this second textbox you will write the option you would like to add to the question and then press the button, so it reaches another js function which will create the mysqli query ready for implement.
Now here is the problem, I don’t know how to send those queries to php, as I can’t directly send them to the database. I’ve searched and found about node.js and AJAX, but I can’t use them as I can’t refresh the page… any help is welcome. Here is the php page and the js (the variables and functions are in spanish, sorry):