Because 10
is a "truthy" value, the condition will always be true. You basically have
if($link == 8 || true) {
because 10 == true
is, in fact, true.
You should adapt it to either
if ($link == 8 || $link == 10) {
or you can use in_array()
if you start to get many values
if (in_array($link, array(8, 10)) {
If you want, you can use strict comparison - if (and only if) $link
is an integer. Then you'd have three equalities, which requires the same value and the same type. This is because PHP is weakly typed, so it doesn't compare types by default (and as a result you can compare different types and have a valid result). Using strict comparison allows you to better control what type of variables you compare.
if ($link === 8 || $link === 10) {