Is it possible to post value in the same page, and caught it in PHP tag without reloading the page?
I've been looking for some references from the Internet, such as using the session, cookies, ajax, etc. But, it can only be used once until the page is refreshed.
My purpose is to load the data from the database and display it in the html table.
I've tried using ajax like this :
$("#submit").click(function(){
var abc = $("#text").val();
var dataString = 'abc1='+ abc;
$.ajax({
type: "POST",
url: "destination.php",
data: dataString,
cache: false,
success: function(result){
alert(result);
}
});
});
And caught it with:
<?php
// if(isset($_POST)){
$number = $_POST['abc1'];
// }
?>