문제

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.

도움이 되었습니까?

해결책

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;
        }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top