in reply to Need help with and If Else structure.
Several comments:
That said, I believe your problem is that you are assigning $status to $ss, but you haven't removed the line separator from the original string with a healthy chomp. So, $status probably looks like "yes\n", which does not match "yes". The quick fix I think is to say chomp($piece) before splitting $piece.
For a better overall approach, take a step back and look at what you're doing. You've got a single username/password combination that you need to compare to a database entry. To find a match, you're running through the entire list of usernames, and even if you find a match, you continue on through the rest. You can trim some of those useless loop iterations with a last statement. Better still is to load that information into a hashtable, as they are built specifically for looking up information rapidly and efficiently.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Need help with and If Else structure.
by ACJavascript (Acolyte) on Jan 01, 2003 at 03:21 UTC |