PHP Read txt file and check if username password exists

前端 未结 3 699
一个人的身影
一个人的身影 2021-01-29 14:12

I have a bunch of passwords and usernames stored in a txt file and i need to check for matches. I know this is not a safe method but its for leaning purposes.

This code

3条回答
  •  日久生厌
    2021-01-29 14:35

    Before you go ahead and try to correct this code, I strongly suggest you stay away from storing passwords in a plain text file. It is a huge security hole in your system.

    Another architecture issue I can see is that your code would fail if the username or passwords contain a space in them. You probably should use line jumps as a delimiter instead (\n).

提交回复
热议问题