1

i am intented to design 5 levels of admins. suppose admin ,admin1,admin2,... will be on dropdown and there is user and passwrod fields according to the admin selected he will redirected to the panel accordingly

<form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">
    <label for='form[]'>Select the Admin:</label><br>
    <select multiple="multiple" name="form[]">
        <option value="admin">admin</option>
        <option value="admin1">admin1</option>

    </select><br>
    <input type="submit" name="formSubmit" value="Submit" >
</form>

And in Controllers i have loaded all the tables of various admin levels. But it seems nothing to be working out. could any1 look into this.

tereško
  • 58,060
  • 25
  • 98
  • 150
user3177068
  • 557
  • 2
  • 5
  • 13
  • Controller should not e responsible for guarding your application. http://stackoverflow.com/a/9685039/727208 – tereško Jan 28 '14 at 07:04

1 Answers1

0

In view

<select name="form[]">
        <option value="admin">admin</option>
        <option value="CS">CS</option>
        ...
        ...


    </select><br>
     Username: <input type="text" name="username">
     Password : <input type="text" name="Password">
    <input type="submit" name="formSubmit" value="Submit" >

In controller

function do_login(){


        if($this->app->getPostVar('login_type')=='Admin'){
        echo "Reaching Admin";exit;
        }

        if($this->app->getPostVar('login_type')=='CS'){
        echo "Reaching CS";exit;
        }

        if($this->app->getPostVar('login_type')=='Mall'){
        echo "Reaching Mall";exit;
        }

        if($this->app->getPostVar('login_type')=='Sales'){
        echo "Reaching Sales";exit;
        }


        if($this->app->getPostVar('login_type')=='Merchant'){
        echo "Reaching Merchant";exit;
        }
Sam
  • 1,106
  • 10
  • 14