Root directory is here:
And "Templates" folder is in root directory:
And the File is located here (remember from my oop):
Now, I deleted all the php code from that file just now.
And wrote only these 2 lines:
echo $selfpage = $_SERVER['PHP_SELF']; echo '<br>';
I get echoed:
So yes, it is assuming the "Templates" folder is in root directory.
I think everything is fine now. It's just I forgot that when a path starts with "/" it assumes it's starting from the root directory.
Q1. Anything else you want to add here, mate ?
Or, is everything fine now ?
It's just, I thought this:
echo $selfpage = $_SERVER['PHP_SELF'];
Would echo this:
Echo echo no root directory nonsense or symbol "/".
But the following code is echoing that instead. Echoing what I really want.
Echoing exactly what I want (just the file name):
And so, I have now decided that, if I want to echo just the file name with no path details such as root "/" then I just gonna use this code:
Q2. Am I gonna do the right thing here ? The code, I mean.
And, if I want to echo the root directory path, like so:
then I will just use the code:
Q3. Am I gonna do the right thing here ? The code, I mean.
But note that, I don't really like this echoed:
Instead, I prefer to echo like following (if I gonna echo the full url with the path and not just the file name):
Q4. So, which code would echo like that ? NogDog. Tell me atleast that. Echo the full url, like I just shown you above. Url starting with the 'domain' if on the web. Else, starting with the "localhost".
Don't forget to answer all 4 questions, especially Q4. Ok ?