Reputation:
Hello everyone I was to trying to set up a variable that store my main directory to save time. I know the problem is something to do with file:// is there anyway round this like changing the file:// into http://?
$Root_Path = $_SERVER['DOCUMENT_ROOT']."/Website";
Upvotes: 0
Views: 4449
Reputation: 3470
try to use:
$Root_Path = "http://".$_SERVER['SERVER_NAME']."/Website";
Output:
http://yourserver.com/website/
UPDATE:
If you really want to get the root, use only:
$Root_Path = "http://".$_SERVER['SERVER_NAME'];
Output:
http://yourserver.com/
Upvotes: 2