$postid = $_POST['postid'];
$pageid = $_POST['pageid'];
echo $postid;
echo $pageid;
<a href='#' class='del' postid='<?=$res['id']?>' pageid='<?=$page?>' data-toggle="modal" data-target="#myModal">open</a>
<script>
$(document).ready(function(){
$('body').on('click', '.del', function(){
var postid = $(this).attr('postid');
var pageid = $(this).attr('pageid');
$.ajax({
type: "POST",
dataType: "json",
url: "http://mod.ru/forum/index.php?id=<?=$id?>&page=<?=$page?>",
data: { postid : postid,pageid: pageid }
});
});
});
</script>