How can I use php to determine which files are invoked and included given a url only.
eg. the URL, http://www.mydomain.com/index.php
might use:
- index.php
- includes.php
- content.html
I want to give php the url and it return the filenames.
Thank you 🙂
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’re not going to be able to do this from a URL. To the outside world a URL is just something that returns a bunch of text. There’s little to nothing that can be done to devine how that text was created.
If you have access to the source code, placing this at the end of your entry file will be a big help.
This will print out every file that’s been included or required in. However, this won’t give you any file that’s been accessed with fopen, file_get_contents, etc. If you’re interested in seeing if a particular file has been accessed or not, the unix
statprogram can tell you this. However, in normal computer operation files are accessed for lots of different reasons, so you’ll want to be careful relying on anything that comes out of stat.