[FX.php List] How do I hide a set of links?

Bob Patin bob at patin.com
Sat Jul 14 16:27:07 MDT 2007


Jon,

If you are using session variables it's really easy:

Assuming you had a field called "usertype" and 1 = MANAGER, 0 = PEON,  
you'd first retrieve the value of the current user, put it into a  
session variable which we'll call 'usertype'.

Now you can do a simple IF statement:

Somewhere in your HTML (wherever you have the links, put this:

<?php if($_SESSION['usertype'] == 1){
?>
HERE'S WHERE YOUR BUTTON, TABLE ROW, OR WHATEVER WOULD GO
<?php
}
?>

Hope this helps,

Bob Patin
Longterm Solutions
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com

   CONTACT US VIA INSTANT MESSAGING:
      AIM or iChat: longterm1954
      Yahoo: longterm_solutions
      MSN: tech at longtermsolutions.com
      ICQ: 159333060




On Jul 14, 2007, at 5:19 PM, Jon Montgomery wrote:

> I am using session data at login.  On my following pages, how do I  
> "hide"
> certain page links from the "users" and show them to the "managers"?
>
> I have tried some code, but am unable to make it work.  Also have  
> searched
> php.net and get no where.
>
> Any help will be greatly appreciated.
>
> Jon Montgomery
> -- 
> Jon Montgomery
> Home phone: 618.542.2287
> School phone: 618.542.2646 ext, 1133
> Cell phone: 618.201.7388
> Home email: vicepresident at comcast.net
> School email: jwmontgomery at dqud300.perry.k12.il.us
>
>
>
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list