Allow a page to only load in an iframe

iframe, load, permissions, php, redirect

Solution

You wouldn't use PHP for that. Try javascript.

if(window==window.top) {
    // not in an iframe
}

Problem

How can I allow my PHP file to only load in an `iframe`? For example: - Prevent direct access: `example.com/Loader.php` - Allow iframe access: `<iframe name="TEST" src="Example.com/Loader.php"></iframe>`

Original source