Support » Plugins » show content depending on where the user comes from

  • I want to show a site description on my article pages if the user comes from another site than my own. I think it has to be done with a some referer code. Does anyone know how do that? I just looking for an simple if then else thingy.

    Thanks,

    JediSthlm

Viewing 3 replies - 1 through 3 (of 3 total)
  • It goes something like this:

    <?php
    $mydomain = 'jedisthlm.com';
    if(strstr(!$_SERVER['HTTP_REFERER'],$mydomain)) {
    ?>

    ~Your description content goes here~

    <?php } ?>

    Thread Starter Jens Wedin

    (@jedisthlm)

    Your awsome 😀
    Thanks alot, I´ll try that right away.

    Thread Starter Jens Wedin

    (@jedisthlm)

    I tried the code but was not able to get it working, I did make some changes and now it works fine. This is what I did.



    <?php
    $mydomain = "jedisthlm";
    $referer = $_SERVER['HTTP_REFERER'];
    $domain = explode(".", $referer);

    if ($domain[1] == $mydomain) {
    echo "<!-- Found an referer, nothing shown -->";

    } else {

    echo "Show something";

    }
    ?>


Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘show content depending on where the user comes from’ is closed to new replies.