I finally was able to solve it, it was some problem in the php code. The final code that Works was:
<?php //function that adds the information received to the table of networks in the database include("connect.php"); //file that manages the connection settings to the database $link=Connection(); //function that connects with the database (specified at connect.php) //while the cue is not empty, receives pairs of Id_networks and name and stores it in the database if (!empty($_POST)) { $idNetw=$_POST["idNetw"]; $netwName=$_POST["netwName"]; $query = "INSERT INTO `wifi_networks` VALUES ('".$idNetw."','".$netwName."')"; print_r($_POST); } else { echo("No data has been sent"); } $result=mysqli_query($link,$query) or die('Error:'.mysqli_error($link)); mysqli_close($link); //header("Location: index.php"); ?>