lundi 28 novembre 2016

I can´t figure out whats wrong with my if statement

I have a if statement, it should redirect visitors if they dont come from facebook, facebook mobile or instagram.

    $ref            =   $_SERVER['HTTP_REFERER'];
    $facebook       =   "http://ift.tt/g8FRpY";
    $facemob        =   "http://ift.tt/2fukxNO";
    $instagram      =   "http://ift.tt/1kwsCwF";

    if ($ref != $facebook or $ref != $facemob or $ref != $instagram) {
        echo "my header location here../ you are not welcome";
    } else{
     echo "Welcome!";
    }
    ?>

It works just fine if i only use if($ref != $facebook) {...ofcause only if i come from a facebook ref. :)

Aucun commentaire:

Enregistrer un commentaire