samedi 26 novembre 2016

PHP If (!isset(...) || !isset(...))

I'm trying to check if the first $_COOKIE['one'] exists OR the second $_COOKIE['two] exists and if none exists to redirect the user.

Only one of those two cookies are going to exist when this script is running.

if (!isset($_COOKIE['one']) || !isset($_COOKIE['two'])) {
    header('Location: ./');
} else {
    ...
}

I tried many things but every time I get into this if altough one of those cookies always exist.

Aucun commentaire:

Enregistrer un commentaire