Page 1 of 1

Display buttons depend on userid

Posted: Mon Nov 07, 2005 10:08 pm
by Scriplet
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.

Posted: Mon Nov 07, 2005 10:11 pm
by John Cartwright
Sorry, what? Could you please explain again?

Posted: Tue Nov 08, 2005 3:48 am
by n00b Saibot
He wants it like this :arrow:

Code: Select all

if ($userid==1)
{
  //display all the buttons
}
elseif($userid==2)
{
  //display update, print & return buttons
}
I do understand you but i haven't (and don't want to :) ) worked with Smarty so I can't help you...