hello masters, I have a problem regarding limiting the pages a certain user can access..in my case, i have added a roleID to my members table...
here is the original code first
<h1>Welcome SICS Admin!</h1>
<ul id='adminmenu'>
<li><a href='index.php'>Modify News Archive</a></li>
<li><a href='categories.php'>Categories</a></li>
<li><a href='users.php'>Faculty</a></li>
<li><a href="../" target="_blank">Department Website</a></li>
<li><a href='logout.php'>Logout</a></li>
</ul>
<div class='clear'></div>
<hr />
then I went on and made it like this but it doesnt seem to work..I'm a novice in Php so bare with me please..i wanted to remove the Faculty tab for a user whose roleID=2.....
<?php
require_once('../includes/config.php');
if ($row['roleID'] = 1) {
echo"<h1>Welcome SICS Admin!</h1>
<ul id='adminmenu'>
<li><a href='index.php'>Modify News Archive</a></li>
<li><a href='categories.php'>Categories</a></li>
<li><a href='users.php'>Faculty</a></li>
<li><a href='./simpleblog/viewpost.php'>Department Website</a></li>
<li><a href='logout.php'>Logout</a></li>
</ul>
<div class='clear'></div>
<hr />";
}
elseif ($row['roleID'] = 2) {
echo"<h1>Welcome SICS Faculty!</h1>
<ul id='adminmenu'>
<li><a href='index.php'>Modify News Archive</a></li>
<li><a href='categories.php'>Categories</a></li>
<li><a href='./simpleblog/viewpost.php'>Department Website</a></li>
<li><a href='logout.php'>Logout</a></li>
</ul>
<div class='clear'></div>
<hr />";
}
?>