Answer the question
In order to leave comments, you need to log in
And how to change the main page for a registered user?
Good afternoon! I ask for your help, dear Toasters :) There is a website, it has two main pages, one for those who are not registered, the second for registered users, here is the code that is responsible for this (if I understood everything correctly). The question is how can I replace it so that the registered user gets to index.php . Honestly, for me, all this is a dense forest. After all, I understand correctly, it is not enough for me to change the line "header('Location: auger.com.ru/catalog ');die();" on header('Location: auger.com.ru/index.php ');die();
<? global $USER; if($USER->IsAuthorized())/*if(1)*/
if ($APPLICATION->GetCurPage(true) == SITE_DIR."index.php"){
header('Location: auger.com. en/catalog ');die();
?>
Answer the question
In order to leave comments, you need to log in
You almost solved the issue!
Home:
<? global $USER;
if($USER->IsAuthorized()) {
include('include/auth_index.php');
} else {
include('include/notauth_index.php');
}
?>
The user logs in through your login form and, when entering the correct data, receives a unique identifier in the cookie in a way convenient for you, after already checking whether the user has such an identifier and whether everything is in order with him, let him into the desired page.
Dig towards the session .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question