I made some variables that contain the answers that are selected in my dropdown menu's. Now I want to use those variables in my .php file so i can make a query of them. But I can't figure out what I'm doing wrong, so here is my code.
This my main.js file:
$("#slctTable").change(function(){
var table = document.getElementById("slctTable");
var tableSelected = table.value;
console.log(tableSelected);
});
$("#slctField").change(function(){
var field = document.getElementById("slctField");
var fieldSelected = field.value;
console.log(fieldSelected);
});
$("#slctAttribute").change(function(){
var attribute = document.getElementById("slctAttribute");
var attributeSelected = attribute.value;
console.log(attributeSelected);
});
And this my getData.php file:
<?php
include "connect.php";
$test1 = $_GET['tableSelected'];
$test2 = $_GET['fieldSelected'];
$test3 = $_GET['attributeSelected'];
echo ($test1);
echo ($test2);
echo ($test3);
?>