Skip to main content
August 28, 2008
Question

Show/Hide Links

  • August 28, 2008
  • 2 replies
  • 318 views
I am creating an employee site with DWCS3 for my school district. I am using php with a mysql database. I am not really skilled in mysql or php. The Tech Serv dept created the database. I have been able to connect to the employee database with DW and users can login using the login page I created with DW. Each user also has an access level, either staff or administrator (admin). I know that I can restrict access to an administrator page based on username, password, and access level. However, I have been asked to not even have the administrator link visible on the index.php page if a person is not logged in as an administrator. What is wanted is for an individual to login and if they are at the staff access level, then they will see all the links to other areas on the employee site except the link for administrators. If an administrator logs in, that person will see all the links everyone else sees and a link - Administrator - and then have access to those pages as well. I thought this had something to do with regions, but I can't figure it out. Can anyone explain how I might do this.
Thank you,
--Linda
This topic has been closed for replies.

2 replies

Inspiring
August 28, 2008
agldgs wrote:
> If an administrator
> logs in, that person will see all the links everyone else sees and a link -
> Administrator - and then have access to those pages as well. I thought this had
> something to do with regions, but I can't figure it out.

It's a simple conditional statement.

if ($_SESSION['MM_UserGroup'] == 'administrator') {
// show links for administrators only
}

Replace 'administrator' with whatever you use for the admin access level.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Participant
August 28, 2008
Here is some info on the restrict access behavior
http://www.communitymx.com/content/article.cfm?cid=CEE05