PHP getting the name of the caller page -
I have a php archive script, PHP-Assets.php contains the most frequently used code in it that keep me Like I'm in a normal place
In other PHP pages, they use a statement included, they call that page and depending on the page, call it some functions.
No, the way to retrieve the file named PHP-Assets.php is therefore, I can create code based on the caller page. Then index.php; Uses PHP-Assets, and PHP-Assets will know that it was index.php that is currently on display on the user-side; And because it knows that the function can return a different answer.
This is superglobal for php Hopefully, what you want, but maybe a better way is to do the script name (or only relevant data?), Only through the function parameters, they need it. $ _ server . With the
$ _ SERVER ['SCRIPT_FILENAME'] you get the name of the script requested by the user (eg index.php).
Comments
Post a Comment