我不是一个有经验的开发人员,但我目前正在学徒,而且我的高级开发人员最近离开了我,并独自一人前往!从GET更改为POST
我从他那里听说,使用'GET'请求比'POST'更好,但是在读完后我想切换到'POST',我唯一的问题是我有点不确定如何修改我的代码来切换从'GET'结束。下面我已经在我们的系统中留下了一个共同的范围。任何帮助将是伟大的
$scope.changenote=function(id,note){
note = encodeURIComponent(note);
var inserthistory = './dbscripts/solicitors/changenote.php?id=' + id + '&user=' + AppStorage.getCurrentUser().username + '¬e=' + note;
console.log(inserthistory);
$http({method: 'GET', url: inserthistory}).success(function(data) {
var historyurl = './dbscripts/solicitors/gethistory.php?ref=' + $scope.bbref;
$http({
method: 'GET',
url: historyurl
}).success(function(data) {
$scope.histnoteaddbtn = [];
$scope.history = data;
$state.go($state.current, {}, {
reload: true
});
});
swal("Saved!", "Your note has been saved!", "success")
})
}
那么这取决于你在做什么系统!我的意思是这是一个CMS或...?而且你不能总是把GET改成POST!有时你需要在一些功能中使用每一个!而关于安全性,POST和GET之间基本没有什么不同!在这两种情况下,您必须使用准备好的查询语句并在查询中使用它之前检查数据! – Soheyl
@GeomanYabes大喊?哪里? –
** Soheyl **的评论..:D总是用'!' –