I’va got a jquery file processing some mysql-data changes using ajax-calls (jQuery api) within php handler file.
This is my 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"); }
}
]
});
});
Inside the handler directory i placed a .htaccess file for managing file access and limit exception:
<LimitExcept GET POST HEAD>
Order deny, allow
Deny from all
</LimitExcept>
But Apache always return 500: Internal sever error. If I delete the .htaccess file everything works fine… How to configure the .htaccess file correctly?
Thx!!!
Kind of dumb, but apache flips out if
Orderis given more than one parameter. You have a space in yours:You just need to remove it: