I am trying to insert a row to the DB via ajax request, but the row is not inserting to the DB
//Simple form
<div class="form_style">
<form action="#" method="POST">
<textarea name="content_txt" id="contentText" cols="45" rows="5"
placeholder="Enter some text"></textarea>
<button id="FormSubmit">Add record</button>
</form>
</div>
And the response.php
if(isset($_POST["content_txt"])){
//MYSQL CLASS
include('includes/mysql.inc.php');
file_get_contents('php://input');
//Accessing the POST variables
$contentToSave = $_POST["content_txt"];
//Inserting the row
$insert_row = "INSERT INTO comments (comment) VALUES
('".$contentToSave."')";
$r = mysqli_query($dbc, $insert_row);
}
else
{
//This block is executing right the moment, seems like $_POST datas not
POSTING
header('HTTP/1.1 500 Error occurred, Could not process request!');
exit();
} //seems like maybe the jquery include file is not proper? but i checked it connecting not locally to the jquery library
But the row is not inserting to the DB