PHP Login system hard coded username and password

后端 未结 3 1942
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-27 11:24

I had to do a basic login system to protect a page, and I have no access to database so i store the username and password hard coded in php page.

My question is, can thi

3条回答
  •  旧巷少年郎
    2021-01-27 11:51

    The problem with temporary solutions is that they've never temporary.

    Never hard code passwords. Some of the reasons are:

    • It is harder to keep source code secret than it is a key.
    • Any vulnerabilities in your site that allow reading of source code may reveal the password.
    • Passwords from development will end up in production.
    • It is impossible to change passwords without redeploying.

提交回复
热议问题