Bearing in mind that I know just enough php to hurt myself, but probably not enough to be a danger to others:
I've got a file that is called in two different ways. If it's included within an existing html document
<!--#include virtual="/paintings/critters/critterlinks.php?subdir=mice&page=${DOCUMENT_NAME}" -->
it creates a navigation footer specific to that page. If it's created "cold"
RewriteRule ^paintings/mice/([a-jw]\w+)\.html /paintings/critters/critterlinks.php?subdir=mice&page=$1 [L]
it builds the entire page, including the footer. (It's the same php file because the page-building process uses some of the same data as the footer-building process, and there's not enough information to merit mucking about with a separate database. Yes, it returns a 404 if it turns out to be a bum request. Different thread.)
Right now I filter them like this
$realpage = 0;
$tester = explode(".",$page);
if(!is_null($tester[1]))
{
$page = $tester[0];
$realpage = 1;
}
Question: Should I instead be looking for a predefined function that checks whether the present file is included within some other file?