Created
April 4, 2017 06:10
-
-
Save zhabinka/3d2310ada71d952233c4188802a8b704 to your computer and use it in GitHub Desktop.
Определение страницы, с которой пришёл пользователь
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Вариант на JS http://shpargalkablog.ru/2015/08/document-referrer.html | |
//Установка переменной в fenom | |
{set $see = $_modx->runSnippet('@FILE snippets/user_transition.php', [])} | |
//Сниппет проверки user_transition.php | |
if (strpos($_SERVER['HTTP_REFERER'], '/shop/') !== false) { | |
return '1'; | |
} | |
//Скрытие блока после проверки | |
<div style="{if $see == '1'}display:none;{/if}"><div> | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment