<script>
function getdetails(obj) {
var btn_id = obj.id;
<!--alert(obj.id);-->
}
</script>
$.ajax({
url: '/script.php',
type: 'post',
data: {'btn_id': 123},
success: function (data, status) {
console.log(data)
},
error: function (xhr, desc, err) {
console.log(xhr);
console.log("Details: " + desc + "\nError:" + err);
}
});
<?php
// http://site.ru/script.php
$post = filter_input(INPUT_POST, FILTER_SANITIZE_STRING);
var_dump($post);