I use template engine(smarty), first I create one template html
<form .... >
...
<input type="button" value="Update">
<input type="button" value="Delete">
<input type="button" value="Add">
<input type="button" value="Print">
<input type="button" value="Return">
...
</form>
In php code, I load this template but I want display buttons depend on userid.
Ex: With userid == 2 , I want display 3 button Update, Print, Return. How to display 3 buttons Update,Print, Return nearly and 2 button Delete,Add don't display.
Display buttons depend on userid
Moderator: General Moderators
Display buttons depend on userid
Last edited by Scriplet on Mon Nov 07, 2005 10:27 pm, edited 1 time in total.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
He wants it like this
I do understand you but i haven't (and don't want to
) worked with Smarty so I can't help you...
Code: Select all
if ($userid==1)
{
//display all the buttons
}
elseif($userid==2)
{
//display update, print & return buttons
}