Звучит так, будто вы спрашиваете об основах Ajax, верно? Я предлагаю использовать jQuery для обработки части Ajax.
Поместите jQuery на свою страницу, а затем сделайте что-то вроде
$(document).ready(function(){
$('#submit_button').click(function(){
var something='value to send to PHP';
$.post('name_of_page.php',{"a_var":something},function(data){ /* do something with the data you received back*/ },'json');
});
});
Затем на вашей странице PHP настройте обработку сообщений или обычный вывод HTML.
<?php
if($_POST['a_var']){
$result=do_something($_POST['a_var']);
echo json_encode($result);
exit;
}
//if there was no POST value, it continues to here
<html>
This is the rest of your page.
You'd have the form and the above javascript and so on here.
</html>