Jump to content

Help with the isset function


Doublea

Recommended Posts

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 :D

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.