Creating and calling functions
View Single Post
03-14-2011, 03:49 PM
Join Date: Aug 2008
I was just mentioning __FILE__ so it is dynamically given, so it is not a static name like test.php
I am just to program the more dynamic to the context, the easier to port code somewhere else.
But that shouldn't be a problem to put the actual static name of the file.
And my bad on __FILE__ that was the wrong case to use it. It returns the absolute path based on the file system so in your case is returning /home/fhlinux010/t/tutorials.tentun.co.uk/user/htdocs/test.php
which a public website can't show, since the public doesn't have access like that.
In this case you can use $_SERVER['PHP_SELF'] instead of __FILE__ which would return just test.php or if you have it in a subfolder it would return subfolder/test.php
I don't think I explained it well since I am in a hurry, but if you check PHP_SELF in
it will explain the differences.
The Following User Says Thank You to tony For This Useful Post:
View Public Profile
Send a private message to tony
Find More Posts by tony