Is there is a way to find the ScriptCase Variable that contains the directory that SC is being run from? I could have sworn I’ve seen it but I can’t find it now.
Or maybe it’s a php function???
Thanks
Is there is a way to find the ScriptCase Variable that contains the directory that SC is being run from? I could have sworn I’ve seen it but I can’t find it now.
Or maybe it’s a php function???
Thanks
Look into the $_SERVER variable. A quick view is var_dump($_SERVER)
Too much care with this. Take a look to this file example using the following structure.
/project/foo.php
/project/includes/bar.php
bar.php content:
<?php
function currentPath();
return __DIR__;
}
foo.php content:
<?php
include "./includes/bar.php";
$path = currentPath();
echo $path;
So… in you execute foo.php file, the result will be project/includes/ instead of project/
… well currentPath() is in bar.php which is in project/includes so I can (kinda) see why that happened.
Why not use “echo DIR;” directly in foo.php?