到PHP變量,這是我的javascript代碼:如何傳遞的值通過AJAX
function category(row){
dataparam = "oper=delete&row="+row;
$.ajax({
type: "POST",
url: "multiupload.php",
data: dataparam,
error:function() {
alert("sorry")
},
success: function(html) {
alert(html);
}
});
}
和我的PHP腳本:
$opers = (isset($_REQUEST['opers']) and $_REQUEST['opers'] != '') ? $_REQUEST['opers'] : '';
if($opers == "delete") {
$row=$_REQUEST['row'];
echo $row;
}
這是不工作...我不知道什麼問題是。請幫我在我的php腳本中獲取$row
變量。
可能的重複http://stackoverflow.com/questions/6130662/passing-javascript-variable-to-php-using-ajax/? – Liam 2011-05-26 13:58:25