PDA

View Full Version : How to disable a hyperlink or a textbox or a command button?


jeffry
02-12-2007, 03:11 AM
hi,
Could any one please tell me How to disable a hyperlink or a textbox or a command button which is in page 2 from page 1?

Suppose i have an admin page and a userpage.I have a details page which holds add,delete,view and search links or buttons or textboxes.

i want to access all these from admin page.But i want userpage to access only the search feature of details page.


how to do this..?plz explain...

rafiki
02-12-2007, 04:34 AM
you obviously have user priveleges set for admin, so find out if that user is an admin, then add an if statement on the HTML output for links you want shown, for example


if ($logusrpriv == $adminpriv) //check to see if user logged in has privelidges for the link/button
{
echo "<a href='http://yoursite.com/youhiddenlink' >Click here for hidden page </a>"; // if they have
}
else
{
echo "Admin Only sorry"; // or if they havent
}




or something similar