exchequer:
> you mentioned that the code is ideal
> for <100 users. what would happen
> if the number exceeds 100? would this
> 'limitation' be a problem if i want to
> let users self-register?
> PS. intend to do this on a text file;
> don't have a MySQL database.
Hi. The one hundred users limit is an empirical limit, and it is not absolute.
The problem is this: parsing a text file in PHP is CPU intensive. The text file is really checked only once (on login), after that, all login information is kept in memory (in session vars) in the server.
If you have 1000 users, when the first user in the list try to login, the script will find his login information quickly. But if the user is the last one, the script will have to parse the whole file to find her information.
How much time it will take? Maybe 10 milliseconds, maybe 5 seconds. That depends on the server capacity and load. I only tested it on a very loaded server (a Linux Slackware, PIII-500MHz server) with 100 users, and the performance was good enough.
So, will it crash your server? No. Will it make your users to wait minutes to login? No. Will your hosting provider tell you that your script is loading the server too much? Maybe. But I don't think so; as I said, the file is only parsed when logging in.
So, maybe I was too conservative when stating "100 users". After all, my development server is slower than most running servers today.
Regards,
Mario A. Valdez-Ramirez.