Hey all,
I'm hoping for someone to point me in the right direction on something that I worked out a long time ago, but since forgotten and now can't seem to find.
I want to deny access to a php file, such as one to be used as an include - so that you are able to execute it when being included into another file, but not if you go directly to the include file in your web browser.
My best thought on how to do this is to check the actual filename to $PHP_SELF, if it's the same - then exit; or similar to cancel execution.
However, how can I automatically get the filename of the actual file to do this? without having to type it in manually each time..
Or otherwise, what would be a better way of doing this?
Many thanks,
Ben