如果我使用 ajax 像这样发布:
$('a.publish').live('click', function () {
var id = $(this).attr('id').replace('item_', '');
var table= $(this).attr('rel');
$.ajax({
type: 'post',
url: "",
data: 'publish=' + id + '&table=' + table,
success: function () {
$('#published_' + id).html(data);
count();
}
});
return false;
});
如何访问 post 变量table
?
我能够提取id
通过:
if (isset($_POST['publish'])) {
$id = intval($_POST['publish']);
Nemesis::update("projects", "published = '1'", "id = '{$id}'");
print "Active";
}