Doublea Posted July 21, 2010 Share Posted July 21, 2010 Hi guys, Hope everyone is well! I'm currently using Facebook Connect for a feature on our site. I am trying to show the text 'You are not logged in' if you are not logged in when you click on 'Attend this event' button. I have figured out how to show that i you are logged in and you click on the button it shows "You are now attending this event". The code for this is: <?php if (isset($attendEvent)) { ?> <br /> <b style="color: red">Your now attending the event! <?=$attendEvent['/127573637277755/attending']?></b> <?php } ?> I am trying to add code so that when you click the button and you are not logged in it it says 'You are not logged in' instead of 'Your now attending this event!' Can anyone help with this? I tried else function but it showed up as soon as you landed on the page not after you clicked on the button. Thanks Quote Link to comment Share on other sites More sharing options...
gwolgamott Posted July 21, 2010 Share Posted July 21, 2010 Use same method as you did before. Just put an exclamation point ! before isset() <?php if (!isset($attendEvent)) { ?> <?php } ?> Quote Link to comment Share on other sites More sharing options...
Doublea Posted July 21, 2010 Author Share Posted July 21, 2010 Thanks gwolgamott - however it is still showing as soon as I go onto the page. I need it to be only visible once the button has been clicked but at the moment it is showing constantly? http://www.wecantbehave.com/facebooktest/index.php is the link to see. Any options? Quote Link to comment Share on other sites More sharing options...
gwolgamott Posted July 21, 2010 Share Posted July 21, 2010 Oh, I think I misread what you wanted. sorry. If you are using sessions to keep track of who's logged in; then you could use session variables perhaps that keep track whether or not you are logged in and use that as the flag to display what you want. http://us.php.net/manual/en/intro.session.php I'd give more of an explanation but with sessions I'm a bit of a noob I don't deal with them often unfortunately to give good advice with regards to them other then to know when I should be using them... then I find someone who knows what they are doing lol 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.