Hartley Posted July 7, 2007 Share Posted July 7, 2007 I have a function that verifies membership status, and thus I have it defining variables. if (!$usergroupid || $usergroupid == "5" || $usergroupid == "6") { $adminapp = "1"; $memberverify = "1"; $footer = "<b>Site Admin:</b> <a href=\"index.php?p=appmanager\">Application Manager</a> - <a href=\"index.php?p=recruit-edit\">Recruitment Updates</a>"; } elseif (!$usergroupid || $usergroupid == "7" || $usergroupid == "9") { $memberverify = "1"; $adminapp = "0"; $footer = ""; } else { $adminapp = "0"; $footer = ""; $memberverify = "0"; } However, if they didn't fall in the previous categories, shouldn't they fall under the else? When I run this function, it ignores the else altogether. =( Link to comment https://forums.phpfreaks.com/topic/58796-solved-else-not-posting-properly/ Share on other sites More sharing options...
BillyBoB Posted July 7, 2007 Share Posted July 7, 2007 can i see this function at work and where u use it in the code? Link to comment https://forums.phpfreaks.com/topic/58796-solved-else-not-posting-properly/#findComment-291730 Share on other sites More sharing options...
Hartley Posted July 7, 2007 Author Share Posted July 7, 2007 Trying to see a way to post this for you to see. The code around it doesn't relate to this. The only bit related is the following that precedes: $pminbox = "SELECT pmtotal, pmunread, userid, usergroupid, username, salt, lastvisit FROM user WHERE userid = " .$_COOKIE['bbuserid']; $pmquery = mysql_query($pminbox); while($pmstatus = mysql_fetch_assoc($pmquery)) { $unread = "{$pmstatus['pmunread']}"; $total = "{$pmstatus['pmtotal']}"; $userid = "{$pmstatus['userid']}"; $username = "{$pmstatus['username']}"; $salt = "{$pmstatus['salt']}"; $lastvisit = "{$pmstatus['lastvisit']}"; $usergroupid = "{$pmstatus['usergroupid']}"; } This gets the user's various forum information (I use the forum groups to determine permissions, thus, that's the usergroupid). What more would you need to help find the problem? Thanks again! Link to comment https://forums.phpfreaks.com/topic/58796-solved-else-not-posting-properly/#findComment-291732 Share on other sites More sharing options...
BillyBoB Posted July 7, 2007 Share Posted July 7, 2007 the only thing i could think of is that it isnt setting the varibles right i really dont know why is the else memberstatus = 0? Link to comment https://forums.phpfreaks.com/topic/58796-solved-else-not-posting-properly/#findComment-291734 Share on other sites More sharing options...
Hartley Posted July 7, 2007 Author Share Posted July 7, 2007 It works fine for reading if they are in the other membergroups, but if they aren't, it just isn't going there. I'm figuring there must be a syntax error somewhere =( Link to comment https://forums.phpfreaks.com/topic/58796-solved-else-not-posting-properly/#findComment-291735 Share on other sites More sharing options...
emehrkay Posted July 7, 2007 Share Posted July 7, 2007 looks like there is a problem with your logic. i bet $usergroup is set because if it is, either one of your if statements are true Link to comment https://forums.phpfreaks.com/topic/58796-solved-else-not-posting-properly/#findComment-291737 Share on other sites More sharing options...
Hartley Posted July 7, 2007 Author Share Posted July 7, 2007 I think I see what you mean, but what would I need to do to fix that? Link to comment https://forums.phpfreaks.com/topic/58796-solved-else-not-posting-properly/#findComment-291740 Share on other sites More sharing options...
emehrkay Posted July 7, 2007 Share Posted July 7, 2007 take out the !$usergroup in each if Link to comment https://forums.phpfreaks.com/topic/58796-solved-else-not-posting-properly/#findComment-291742 Share on other sites More sharing options...
Hartley Posted July 7, 2007 Author Share Posted July 7, 2007 That's it! Going to polish up the code and continue to add. Thank you! Link to comment https://forums.phpfreaks.com/topic/58796-solved-else-not-posting-properly/#findComment-291748 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.