i.e. /home/yoursite/public_html
That is an example of a site path, but how do I know what mine is? Ive got the yoursite and public_html but what to I put for the beginning IE: /home/??????
i.e. /home/yoursite/public_html
That is an example of a site path, but how do I know what mine is? Ive got the yoursite and public_html but what to I put for the beginning IE: /home/??????
$pathToThisFile = dirname(__FILE__) ;
jdorsch wrote:
$pathToThisFile = dirname(__FILE__) ;
newbee here I dont understand what you mean by that
imserving wrote:newbee here I dont understand what you mean by that
You just put that code in your file
$pathToThisfile = dirname(__FILE__) ;
// if this code is in a file in this path /home/some/path/site/myfile.php
// then....
echo $pathToThisFile ;
// the above will echo /home/some/path/site/
So if you ever need to find out the path to your project, just use dirname(FILE) to get it.