I think the best way to achieve it is by making asynchronous calls to deliver desired content without reloading the entire page.
This can be done with Javascript or JQuery. JSON will be the protocol you will use to send data back and forth, so you can pass on parameters and get results from your queries using a quite simple XML based format.
But there is a lot of different ways to accomplish this. To improve your question I'd suggest you to follow the link below:
[https://stackoverflow.com/help/how-to-ask][1]
For now, just to show you a general approach, you can use JQuery to call a PHP page that will feed back any content you need. It goes like this:
var params = {
"param1" : param1_value,
"param2" : param2_value,
};
var url = "page_to_call.php";
$.ajax({
context : this,
type : "POST",
url : url,
data : params,
dataType: "json",
encode : true
})
.done(function(data){
console.log(data);
})
.fail(function(data){
console.log(data);
});
Whatever you want to return after this call can be send back like this:
<?php
$return = array();
$return["SOME_DATA"] = "some content here";
echo json_encode($return);
?>