emehrkay Posted February 24, 2007 Share Posted February 24, 2007 was that not supposed to work because it did. it says logout at the bottom Quote Link to comment Share on other sites More sharing options...
magic2goodil Posted February 24, 2007 Author Share Posted February 24, 2007 try logging in with the incorrect pass and/or user the correct login works just fine Quote Link to comment Share on other sites More sharing options...
emehrkay Posted February 24, 2007 Share Posted February 24, 2007 i would say instead of the else statements define the properties in the class private $mode = 'user'; private $valid = false; and they'll only change if the user is logged in Quote Link to comment Share on other sites More sharing options...
magic2goodil Posted February 24, 2007 Author Share Posted February 24, 2007 Well, I did that but for some weird reason, when I login incorrectly it still goes to a blank white screen. Quote Link to comment Share on other sites More sharing options...
magic2goodil Posted February 24, 2007 Author Share Posted February 24, 2007 Do I have a syntax error or something for when it reads the else stating that the mode is user and not admin? Although that else is caught just fine IF I don't attempt a login at all.... I am very confused.. Quote Link to comment Share on other sites More sharing options...
magic2goodil Posted February 24, 2007 Author Share Posted February 24, 2007 I wanna say thanks for your input so far. I would really really like to be proven that my code is at error here and how exactly I guess. For now I feel it seems to be some odd error with PHP5... Quote Link to comment Share on other sites More sharing options...
magic2goodil Posted February 24, 2007 Author Share Posted February 24, 2007 After doing some more testing it seems this error is the same thing in every version of PHP I have tried it on. It returns a blank page when validUser() evaluates to false. So it must be a coding error on my part. I was trying something new by doing things this way, but what did I do wrong. I challenge you to go back to the first part of this thread, examine my code, and tell me why when validUser() evaluates to false, does it show a blank white screen instead of print out the calendar in user mode. Quote Link to comment Share on other sites More sharing options...
btherl Posted February 25, 2007 Share Posted February 25, 2007 Hi magic, I took a closer look at your code.. try the following short script $a = 0 or die("0 is treated as false by 'or'\n"); Then look at your validUser() method Quote Link to comment Share on other sites More sharing options...
magic2goodil Posted February 25, 2007 Author Share Posted February 25, 2007 Where exactly do you suggest I add that? Quote Link to comment Share on other sites More sharing options...
btherl Posted February 25, 2007 Share Posted February 25, 2007 I'm not suggesting you add that to your script. I'm just demonstrating that if you say "0 or die", then php will die. In your script you call "mysql_num_rows() or die()". But if there are 0 rows returned, php will die, because 0 is "equal" to false in php. Was validUser() ever tested on its own? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.