hello i want to get text from textarea and register in database but not work where is problem thanks all. $get_text show empty value.
<script type="text/javascript">
$(function() {
$(".new_post").click(function(){
var get_text = $("#post_text").val();
$.ajax({
type: "POST",
url: "ajax/ajax_new_post.php",
data: get_text,
success: function() {
alert(get_text);
$('#post_text').val('');
//$(this).parents(".show").animate({ backgroundColor: "#003" }, "slow")
//.animate({ opacity: "hide" }, "slow");
}
});
return false;
});
});
</script>
<body>
<textarea id="post_text" placeholder="What's on your mind?"></textarea>
</body>
ajax_new_post.php
$get_text = $_GET['get_text'];
mysqli_query($Connection, "INSERT INTO posts VALUES('$ID', '$get_text')");