I have three <td> tags that I need to either hide or show, based on access
level defined in a cookie.

the three buttons are:
secure (to show when accessLevel = 1)
sales (to show when accessLevel = 2)
login (to show when there is no cookie)

I have had some success with to following code:

_________________________________
<tr> <?php if(strlen($_COOKIE['levelCookie']) == 1) { ?>

      <td height="22" class="menutable"><input name="Submit5292222"
type="button" class="menutext"
onClick="MM_goToURL('parent','http://atricure.com/test/secure/secure.php');r
eturn document.MM_returnValue"
onMouseOver="pviiClassNew(this,'menutextoverdown')"
onMouseOut="pviiClassNew(this,'menutext')" value="secure"></td>
    <?php } ?>
</tr>
    <tr><?php if(strlen($_COOKIE['levelCookie']) == 2) { ?>

      <td height="22" class="menutable"><input name="Submit5292222"
type="button" class="menutext"
onClick="MM_goToURL('parent','http://atricure.com/test/secure/sales.php');re
turn document.MM_returnValue"
onMouseOver="pviiClassNew(this,'menutextoverdown')"
onMouseOut="pviiClassNew(this,'menutext')" value="sales"></td>
    <?php } ?></tr>
    <tr><?php if(strlen($_COOKIE['levelCookie']) < 1) { ?>
      <td class="menutable" height="22">
      <form action="<?php echo "$PHP_SELF"; ?>" METHOD="POST"
name="UserLoginForm" id="UserLoginForm">
          <table width="145">
            <tr>
              <td class="menutextsmallleft" colspan="2"><p
class="alertText"><br><?php echo "$errorMessage"; ?><br>
               </p>
                <p>Login: <br>
                    <input name="UserName" type="text" id="UserName"
size="20" value="<?php echo $_COOKIE['acCookie']; ?>">
                </p></td>
            </tr>
            <tr>
              <td class="menutextsmallleft"colspan="2"><p>Password: <br>
                <input name="Password" type="Password" id="Password"
value="" size="20">
              </p></td>
            </tr>
            <tr>
              <td width="100">&nbsp;
            </td>
              <td width="40"><input name="Login" type="submit"
class="submitButton" id="Login" value="Login"></td>
            </tr>
          </table>
       <input name="action" type="hidden" id="action" value="login">
      </form></td><?php } ?>
    </tr>

___________________________________

the problem that I am having is that when I change one of the strlen
comparisons, it affects the others......so i get one or two of the
parameters to work and the other doesn't.....i change the third and it
works, but now the other two don't.  With the above code, it works for:
login and secure....but not for sales.  If  i change the sales comparison,
then the other two don't work anymore............yee gads, very frustrating.

Thanks for any help....I am desperate!!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to