How can I code a php file to execute only if the file is included. For example in this form it won't run (or will be redirected to another page):
www.example.com/file.php
And in this form it will run:
<?php
include 'file.php';
?>
Is that possible?