Answer the question
In order to leave comments, you need to log in
How to add a specific block from a specific page?
Good afternoon. There are 2 pages:
if($_SERVER['HTTP_REFERER'] == "/user"){
echo "Зашёл с аккаунта";
} else if ($_SERVER['HTTP_REFERER'] == "/cart") {
echo "С корзины зашёл";
} else {
echo "3 вариант";
}
Answer the question
In order to leave comments, you need to log in
Because the full address is stored in - " https://domain.ltd/user "$_SERVER['HTTP_REFERER']
if (strpos($_SERVER['HTTP_REFERER'], '/user')) {
echo 'Зашёл с аккаунта';
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question