Reply to Re: userlevels

Your name:

Reply:


Posted by Alvaro G Vicario on 06/27/05 14:50

*** birdy wrote/escribió (Mon, 27 Jun 2005 13:24:03 +0200):
> I want to display data from a mysql database.
> Thats no problem but i want to hide some fields for some users.
> I understand i have to use userlevels for that.
> But to implement it in dreamweaver is the problem
> When i try to use a var there is nothing displayed at all
>
> <?php echo $row_DetailRS1['Off_soort_2']; ?>
>
> is the code line, it is a part of a master/detail page.
> this data should only be displayed on certain userlever (1-99) else no
> acces.
>
> please help me i'am newbie

I'm afraid your question is not PHP-related but Dreamweaver related.
Userlevels is probably a tool provided by your editor, it doesn't exist as
such in PHP or MySQL.

As about a pure PHP solution, it'd be something like this:

switch($_SESSION['user_type']){
case 'admin':
$sql='SELECT foo, bar, blah FROM table';
break;
case 'moderator':
$sql='SELECT foo, bar FROM table';
break;
case 'user':
$sql='SELECT foo FROM table';
break;
default:
die('Error: Not logged');
}

However, I can't tell you how to implement it in Dreamweaver.

--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация