Hide Database Login Information in PHP Code

前端 未结 2 1646
太阳男子
太阳男子 2021-02-08 23:49

im a total beginner in web programming. Im trying to create a simple website that is reading data from a SQL Database. At first i just wrote my database password and login direc

2条回答
  •  既然无缘
    2021-02-09 00:16

    You normally put this in a configuration file and you access the configuration values via PHP.

    Usually a project is organized such that your application code and your configuration code is outside your webroot and only your public resources (index.php, images, scripts or other resources) are available via direct access.

提交回复
热议问题