Receive url cake php [duplicated]

1

I want to know how to do the following:

When the page comes from google, I want to change the page if the page is found from the google search engine, and to show another one if the url is entered manually

    
asked by Andrés Vélez 28.03.2018 в 17:43
source

1 answer

1

You can check the HTTP_REFERER parameter:

if(strpos($_SERVER["HTTP_REFERER"], "google")!==false) {
    echo "Has llegado desde google";
} else {
    echo "Has llegado de otra manera";
}
    
answered by 29.03.2018 / 00:05
source