function GetThisDir() { $doc_root = strlen($_SERVER['DOCUMENT_ROOT']); return "http://" . getenv("HTTP_HOST") . substr(dirname(__FILE__),$doc_root); }