Easy login script without database

后端 未结 10 1943
说谎
说谎 2020-12-04 20:17

How do I create an easy login script that does not require a database. I would like it to be safe.

Alright, what about this script, i just made it by my knowledge in

10条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-04 21:11

    Save the username and password hashes in array in a php file instead of db.

    When you need to authenticate the user, compute hashes of his credentials and then compare them to hashes in array.

    If you use safe hash function (see hash function and hash algos in PHP documentation), it should be pretty safe (you may consider using salted hash) and also add some protections to the form itself.

提交回复
热议问题