I'm wondering if there's something similar to the register_shutdown_function that gets called when a script starts execution (register_startup_function?), like BEGIN in Perl or the 'application.cfm' file in Coldfusion.
I'm using a system similar to Webbox or Fusebox where a single index.php file includes the appropriate content based on passed parameters. I'd like some way of confirming that any page that gets loaded is loaded via the index file and not directly e.g.,
Allow someone to access the login page via 'http://site.com/index.php?pg=login' where index.php loads login.php
but redirect if someone tries to load it directly;
'http://site.com/login.php'
I realize there's a couple of ways around this. For one, I could check for some value that gets set in the index file at the beginning of each content page and redirect if it's not set but I'm hoping there's a way to do it without having to add logic to every content page. Another would be to store the content files outside the http directory which I do but I still include some in http directory for customization puposes.
Thanks,
Dave