Hey I'm trying to change the visibility of my layer, using the following code....

<div id="menuLog"><?php if ($userLoggedIn == 1) { echo ("style='visibility: visible;'"); } else { echo ("style='visibility: hidden;'") ;}?></div>

Im not really sure what to change, I've run out of ideas!

Please help!

    I think the problem is that you're closing your first div tag before you give it the style property.
    Why don't you try something like this:

    <div id="menuLog" <?php
    if ($userLoggedIn == 1) {
      echo ('style="visibility: visible;"');
    } else {
      echo ('style="visibility: hidden;"') ;
    }
    ?>>
    </div>

    you could also try the display:none; to hide or display:block; to show, don't know what you want to do.

      If if they're not logged in, just don't output it. (That would make sense; if they're not supposed to see it, don't give it to them in the first place.)

        What I have is 2 layers, one called menu the other called menuLog before the user logs in menu is displayed which works fine as ive set at design time the visibility to visible and the visibility of menuLog to hidden. When the user is logged in IE userLoggedIn == 1, I want it to make the menu layer hidden, and the menuLog hidden.

          Write a Reply...