简体   繁体   中英

Angularjs - Mysql - CRUD operations and Security

I'm developing an website app using angularjs, mysql, facebook java SDK and php. The app needs to perform some crud operations regularly but, I reckon that making using a javascript framework to do these present you with a major security hole.

All code/ querys/ stored procedures are written in client side things. So, I was wandering what are the options to make secure crud operations using anjularjs?

I read somewhere that setting a RESTful server and using an authentication mechanism could do the trick, but beeing tottaly ignorant about security, I'm not quite sure.

Can anyone point me to a direction?

Thank you.

Well, you don't expose your security credentials or write SQL queries directly on your client side. In general with AngularJS you will do GET/POST json to your back-end (PHP server, I presume).The PHP will handle all the CRUD operations on the backend.

Example of json data you would pull from your back-end:

$scope.getAuctions = function() {
    $http.get("/auctions/auctions.json").success(function(data) {
        $scope.auctions = data;
    });

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM