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 Link to comment https://forums.phpfreaks.com/topic/39750-php-521-has-bugs/page/2/#findComment-192802 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 Link to comment https://forums.phpfreaks.com/topic/39750-php-521-has-bugs/page/2/#findComment-192803 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 Link to comment https://forums.phpfreaks.com/topic/39750-php-521-has-bugs/page/2/#findComment-192806 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. Link to comment https://forums.phpfreaks.com/topic/39750-php-521-has-bugs/page/2/#findComment-192809 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.. Link to comment https://forums.phpfreaks.com/topic/39750-php-521-has-bugs/page/2/#findComment-192817 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... Link to comment https://forums.phpfreaks.com/topic/39750-php-521-has-bugs/page/2/#findComment-192821 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. Link to comment https://forums.phpfreaks.com/topic/39750-php-521-has-bugs/page/2/#findComment-193091 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 Link to comment https://forums.phpfreaks.com/topic/39750-php-521-has-bugs/page/2/#findComment-193313 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? Link to comment https://forums.phpfreaks.com/topic/39750-php-521-has-bugs/page/2/#findComment-193321 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? Link to comment https://forums.phpfreaks.com/topic/39750-php-521-has-bugs/page/2/#findComment-193333 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.