phpハンドラーファイル内でajax-calls(jQuery api)を使用してmysql-dataの変更を処理するjqueryファイルを取得しました。
これは私のJavaScriptです:
$('#control1').click(function() {
$('#control2').dialog({
show: "blind",
hide: "explode",
width: "auto",
draggable: false,
modal: true,
resizable: false,
buttons: [
{
text: "Save",
click: function() {
$.ajax({
cache: false,
type: 'POST',
url: 'handler/some.handler.php',
data: $('#Form1').serialize(),
dataType: 'json',
beforeSend: function() {
$('#Control3').fadeIn('fast');
},
success: function (data) {
if (data.success) {
alert(data.message);
$(this).dialog("close");
location.reload();
} else {
alert("Error occurred: " + data.message);
}
},
error: function(xhr, ajaxOptions, thrownError) {
alert("Error during process: " + thrownError);
},
complete: function () {
$('#Control3').fadeOut('fast');
}
});
}
},
{
text: "Cancel",
click: function() { $(this).dialog("close"); }
}
]
});
});
ハンドラーディレクトリ内に、ファイルアクセスを管理して例外を制限するための.htaccessファイルを配置しました。
<LimitExcept GET POST HEAD>
Order deny, allow
Deny from all
</LimitExcept>
ただし、Apacheは常に500を返します:内部サーバーエラー。.htaccessファイルを削除すると、すべて正常に機能します... .htaccessファイルを正しく構成するにはどうすればよいですか?
どうも!!!