Directly accessing server database via Ajax (without PHP or some other intermediate)

后端 未结 3 1992
时光说笑
时光说笑 2020-12-07 01:39

With powerful frameworks like jQuery, it seems to be possible to build an entire app logic on the client side. It\'s very much analogous to building a client app as a native

3条回答
  •  庸人自扰
    2020-12-07 02:14

    Well, the annoying part is going to be authentication.

    Because code is ran completely on the client side, the client then knows all of the authentication details to access the database server.

    This is rather .. err ... unsafe. Which is probably why not many people have developed a direct-access server..

    If you really want to keep the PHP/Server-Side scripting to a minimum, make a fairly robust PHP proxy than properly escapes all data. Keep the configuration details in a separate protected ini file, or even the php.ini file, and you can pretty much ignore the server-side scripting after that.

提交回复
热议问题