Hello Everyone,
i am trying to use smarty and i need to be able to dynamically get the base path for a site. Here is my directory structure
/index.php
/includes/global.php
/includes/all class files here
/smarty/all smarty stuff here
ok what i am doing is in the global.php i have these lines of code
define('INCLUDE_DIR', str_replace('\', '/', dirname($SERVER['PATH_TRANSLATED']).'/includes'));
define('SMARTY_DIR', str_replace('\', '/', dirname($SERVER['PATH_TRANSLATED']).'/smarty'));
however i can't seem to get them to work, at this time they do not work, but when they did they would work either using http://localhost and then not work for http://localhost/forum/
the reason it wouldn't work in /forums/ is because it would be setting the constant to
c:\inetpub\wwwroot\forums\includes and that folder doesn't exist
i have tried this using FILE but that doesn't seem to work either, can anyone tell me if there is a way to get c:\inetpub\wwwroot\includes and c:\inetpub\wwwroot\smarty
no matter what directory i am in and this will also be installed on linux so it can't have anything hard coded.
Any help would be appreciated..