how to know what files were required/include?
Moderator: General Moderators
-
Cruzado_Mainfrm
- Forum Contributor
- Posts: 346
- Joined: Sun Jun 15, 2003 11:22 pm
- Location: Miami, FL
how to know what files were required/include?
i don't have any coding yet, but my question is, how can i know what files were required/included in a php page by using include or require?
Hi,
If I understand your question (which, admittedly is not a certainty) You are looking for the file names that were included/required to create an output page that I guess you are looking at.
One of the many beauties of PHP is that this is impossible unless you have access to the web-server's root and can get to the pre-server source code for that page. [In that case, what you are looking for is before the <HEAD> tag in the source code.]
All of the include and require directives are pre-processed by the server and there is no client-side output associated with the directives themselves although the included/required code itself does create HTML output.
PHP...Gotta love it.
Sorry if I didn't understand your question properly.
-----------------------
SteedVLX
If I understand your question (which, admittedly is not a certainty) You are looking for the file names that were included/required to create an output page that I guess you are looking at.
One of the many beauties of PHP is that this is impossible unless you have access to the web-server's root and can get to the pre-server source code for that page. [In that case, what you are looking for is before the <HEAD> tag in the source code.]
All of the include and require directives are pre-processed by the server and there is no client-side output associated with the directives themselves although the included/required code itself does create HTML output.
PHP...Gotta love it.
Sorry if I didn't understand your question properly.
-----------------------
SteedVLX
-
Cruzado_Mainfrm
- Forum Contributor
- Posts: 346
- Joined: Sun Jun 15, 2003 11:22 pm
- Location: Miami, FL
i understood that php won't let you know because of possible security problems.. right? then i guess i will have to do something like this:
is that right?
Code: Select all
<?php
$is_page_one_loaded = (@include 'mypage.php') ? true: false;
?>That is a little out of my ballpark. Sorry.
But, IMHO if you have the session variable ($is_page_one_loaded) registered, and you set its value to true within the included script, then it will work just fine.
I Think I'll try it myself when I get a chance.
Anybody else?
---------------------------
SteedVLX
But, IMHO if you have the session variable ($is_page_one_loaded) registered, and you set its value to true within the included script, then it will work just fine.
I Think I'll try it myself when I get a chance.
Anybody else?
---------------------------
SteedVLX
if your goal is to make sure something is loaded you can use
include_once() and require_once()
But, if you need this it sort of proves that the programming methods/layout etc is not very good, the structure and such should be in a controlled way.. Very understandable if you are hacking a couple of different scripts/programs together or similar.
include_once() and require_once()
But, if you need this it sort of proves that the programming methods/layout etc is not very good, the structure and such should be in a controlled way.. Very understandable if you are hacking a couple of different scripts/programs together or similar.