Iframe Detection With PHP

Normally, I thought that it is not very possible because php is a server-side language, but it is possible. In fact, it's possible now :)

if ($_SERVER['HTTP_SEC_FETCH_DEST'] === 'iframe') {
    // iframe
} else {
    // not iframe
}

Don't forget to pass the value of $_SERVER['HTTP_SEC_FETCH_DEST'] to isset() just in case, because it may not work in older versions.

Comments

There are no comments, make the firs comment