else if condition

Discussion in 'PHP' started by jmurphy444, Feb 24, 2011.

  1. #1
    I am trying to have a specific user not allowed to see a link if THEY are logged in. Here is the basic code for everybody...if logged in they can see the SETTINGS tab.....I want an addition to this.

    (code)
    <?php if( $this->user->is_logged ) { ?><a href="<?= $C->SITE_URL ?><?= $this->user->info->username ?>" id="username"><span>Welcome <?= $this->user->info->username ?></span></a></td>
    <td width="10" align="center" bgcolor="EFEFEF">&nbsp;</td>
    <td width="250" align="right" bgcolor="EFEFEF">
    <div>
    <a href="<?= $C->SITE_URL ?>settings"><b><?= $this->lang('hdr_nav_settings') ?></b></a> |
    <a href="<?= $C->SITE_URL ?>signout"><b><?= $this->lang('hdr_nav_signout') ?></b></a></div>
    <?php } else { ?>



    ------------- this needs to have the user "Anonymouse" if logged in to NOT see the SETTINGS tab.

    Any ideas?
     
    jmurphy444, Feb 24, 2011 IP
  2. srisen2

    srisen2 Peon

    Messages:
    359
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    i usually check the database and it a variable is not true or the users session id does not match an account then you just redirect them

    you can also do a

    if ($member == 1){
    echo "settings options";
    }
     
    srisen2, Feb 24, 2011 IP