私はCMSを使用しています。HTMLコードを入れると、「hello World」のような単純なPHPコードを入れると、データベースに接続しようとすると、うまくいきます。しかし、「phpinfo()」のようなより複雑なPHPコードや、"$reponse = $bdd->query('SELECT * FROM insription_14juin');"
それが機能しないようなSQLステートメントを配置すると。私がフィドラーを使って受け取るメッセージは
403 Forbidden
You don't have permission to access /admin/modules/gestion_articles/updateContenu.php
on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
複数のテストを行った後、JavaScriptファイルがPHPファイルに情報を読み込もうとしていると思います。明らかに、PHPコードが複雑な場合、JavaScriptファイルにはPHPファイルにアクセスする権限がありません。
これはJavaScriptファイルです:
$(function() {
$('#savemodif').click(function() {
$('#formModif').append('<img src="images/ajax-loader.gif" alt="Enregistrement en cours..." id="loadingImg" />');
var contenu ="";
var type = $('#type').val();
if(type == '0')
{
tinyMCE.triggerSave();
contenu = $('#contenu').val();
contenu = encodeURIComponent(contenu);
}
else
{
contenu = $('#contenu').val();
contenu = encodeURIComponent(contenu);
}
/* Récupération d'infos nécessaires à la mise à jour */
var id = $('#idcontenu').val();
var oldtitre = $('#oldtitre').val();
/* Récupération des mises à jours */
var titre = $('#titre').val();
var date = $('#date').val();
var publie = 0; if($('#publie').is(':checked')) publie = 1;
var diapo = '0'; if($('#diapo').is(':checked')) diapo = '1';
var prive = 0; if($('#prive').is(':checked')) prive = 1;
$.ajax({
url: 'modules/gestion_articles/updateContenu_test.php',
type: 'POST',
data: 'id='+encodeURIComponent(id)
+ '&oldtitre='+encodeURIComponent(oldtitre)
+ '&titre='+encodeURIComponent(titre)
+ '&date='+encodeURIComponent(date)
+ '&contenu='+contenu
+ '&publie='+encodeURIComponent(publie)
+ '&diapo='+encodeURIComponent(diapo)
+ '&prive='+encodeURIComponent(prive),
success: function(result) {
$('#result').html(result);
$('#loadingImg').fadeOut(1000, function() {
$(this).remove();
});
}
});
$('#oldtitre').attr('value',titre);
return false;
});
});
すでにcpanelで権限を変更しようとしましたが、機能しません。すべてのhtaccessファイルの名前を変更しましたが、機能しません。
どんな助けでもいただければ幸いです。