Cory94bailly Posted June 14, 2008 Share Posted June 14, 2008 My code: <?php require('config.php'); if(isset($_COOKIE['ID_fcs_member'])) { //Look for the cookies $username1 = $_COOKIE['ID_fcs_member']; $pass1 = $_COOKIE['Key_fcs_member']; $username2 = $_COOKIE['ID_fcs_team']; $pass2 = $_COOKIE['Key_fcs_team']; // Fetch data $check1 = mysql_query("SELECT * FROM members WHERE username = '$username1'")or die(mysql_error()); $check2 = mysql_query("SELECT * FROM team WHERE username = '$username2'")or die(mysql_error()); if (mysql_num_rows($check1) > 0) { //They have a member's cookie! $login_logout = "<a href='logout.php'>Logout</a>"; } elseif (mysql_num_rows($check2) > 0) { //The have a team cookie! $login_logout = "<a href='logout.php'>Logout</a>"; } } else { $login_logout = "<a href='login.php'>Login</a> <img src='images/splitter.gif' class='splitter' alt='' /> <a href='register.php'>Register</a>"; } print $login_logout; ?> Obviously, that isn't working... How can I make it so if they are logged in as a member OR team, it shows logout but if they are not logged in, shot Login and Register? I have all that BUT when I log in as a member, it's fine.. If I log in as team.. the cookie gets set but it still shows Login and Register... All help appreciated. Link to comment https://forums.phpfreaks.com/topic/110235-recognizing-4-different-cookies/ Share on other sites More sharing options...
Cory94bailly Posted June 14, 2008 Author Share Posted June 14, 2008 Bump Link to comment https://forums.phpfreaks.com/topic/110235-recognizing-4-different-cookies/#findComment-565671 Share on other sites More sharing options...
phpSensei Posted June 14, 2008 Share Posted June 14, 2008 <?php if(isset($_COOKIE['username'])){ // show profile } else { // login / register } ?> that what you want? Link to comment https://forums.phpfreaks.com/topic/110235-recognizing-4-different-cookies/#findComment-565672 Share on other sites More sharing options...
Cory94bailly Posted June 14, 2008 Author Share Posted June 14, 2008 Nope... That's only 1 cookie, we need to find 2.. Link to comment https://forums.phpfreaks.com/topic/110235-recognizing-4-different-cookies/#findComment-565673 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.