I still stand by my statement that his PHP code is complete nonsense. It is not in any stretch of an imagination, what he should be doing in a proper login script (which is in his subject line). I would gladly offer the gentleman some assistance in building a proper validation script, but it seems he has abandoned this thread, leaving only us to split hairs.
Between a syntax error and a methodology error the later is more sever. Syntax errors are easily correctable, methodology errors require attaching the problem from a new approach, which in most cases requires a complete rewrite of applicable code.
I’ve written plenty of nonsense code in my day, so I ought to be able to spot it too. I would have loved to have had someone to tell me my code was nonsense, before I spend aggravating hours, days, weeks, only to find on my own my code was nonsense. I don’t make any claims as to coding ability, I just get the job done.