私はangularJS検証でフォームを作成しましたが、私のコードはlocalhostで正常に動作しています。 Webサーバー上でコード全体をアップロードしようとすると、angular.min.jsファイルの行72に403エラー(禁止)が発生しました。403角度(ポスト)を使用しているhttpリクエスト中にエラーが発生しました
私はたくさんのソリューションを試しましたが、私はこの問題に固執しています。
これは私がjavascriptファイルに持っているものですが、問題は私のサーバーやそこから来ているようですが、私はこの403エラーのために私のinsert.new.php
ファイルに入っていません。
function FrmController($scope, $http) {
$scope.errors = [];
$scope.msgs = [];
$scope.titles = [];
$scope.SignUp = function() {
$scope.errors.splice(0, $scope.errors.length); // remove all error messages
$scope.msgs.splice(0, $scope.msgs.length);
$scope.titles.splice(0, $scope.titles.length);
$http.post('insert.new.php', { 'uname': $scope.username, 'email': $scope.useremail }).success(function(data, status, headers, config) {
if (data.msg != '') {
$scope.titles.push(data.title);
$scope.msgs.push(data.msg);
sendContactForm();
} else {
$scope.titles.push(data.title);
$scope.errors.push(data.error);
sendContactForm();
}
}).error(function(data, status) { // called asynchronously if an error occurs
// or server returns response with an error status.
$scope.titles.push(data.title);
$scope.errors.push(status);
sendContactForm();
});
}
}
が、私は私のウェブサイトのルートに.htaccessファイルを入れてみました、ファイルは
Order Allow,Deny
Allow from all
私は私のウェブサーバ自体には何も変更していないが含まれ、それが「ファイアウォール」はそのIそれが助けになる場合には無効にしようとしましたが、それは何も解決しませんでした。
angular.min.js:72 POST http://domain.com/insert.new.php 403 (Forbidden)
angular.min.js:72 XHR finished loading: POST
"http://domain.com/insert.new.php".
私は思う:私はクロームの「ソース」タブでは、送信すると
(このバージョンは、このコードで動作する最新バージョンである)私が手AngularJS 1.2.3を使用して
Apacheの/サーバーの設定と関係がある大きなチャンスがありますが、私はそれを解決することができず、今まで私が見つけたものは何も私を助けませんでした。