R
R
rollex_x932017-01-12 00:32:22
PHP
rollex_x93, 2017-01-12 00:32:22

How to implement a redirect from the authorization page with the output of certain blocks (inputs, forms)?

The bottom line is, there is a page on which there are three buttons, before getting to it, the user passes authorization, during which, through a variable, I assign a group to him, like this (if you tell me how to make it easier, I will be grateful)

if($user_data['pass'] == $pass)
  {
    echo "OK";
    if($user_data['login'] == 'test1')
    {
      $check = 1;
    }
    else
    {
      if($user_data['login'] == 'test2')
      {
        $check = 2;
      }
      else
      {
        if($user_data['login'] == 'test3' or 'test4' or 'test5' or 'test6' or 'test7')
        {
          $check = 3;
        }
      }
    }

  }
  else
  {
    echo "Неверный пароль/логин";
  }

After that, I need a redirect to the main page of the site, where with check = 1, the entire page is available, with check = 2, everything except for one button, with check = 3, everything except for 2 buttons, etc. At the same time, this condition must be preserved for other pages from this site, in other words, after the main one, each user can go to other pages of the site, where again, some group has more functionality available, and some less.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Gevoskiy, 2017-01-12
@rollex_x93

if($user_data['group'] == '1'){ $check = 1; }
if($user_data['group'] == '2'){ $check = 2; }
if($user_data['group'] == '3'){ $check = 3; }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question