PDA

View Full Version : Checking what the include is runing in befor runing script...


sir pannels
12-31-2002, 02:33 PM
hey!
Hmm i duno how possible if at all this is... but..
I have a main page that works like this...
page.php?view=pagename
and then the script pulls out pagename.php and includes it witha php include into the page.php... but is there away i can check to see that the "view" page is being ran via that page.php? so that it cannot be ran unless its inside page.php ?
any info would be great :thumbsup:
cheers
P :cool:

Kiwi
12-31-2002, 04:16 PM
Make the writing of html from pagename.php a function, and call it from page.php. Alternatively, put a variable in page.php and, if that variable is not set, then load an error page header, otherwise, load pagename.php.

There are probably a lot of other ways of doing it; these two are the first I can think of, off the top of my head.