<?php
$server = $_SERVER["SERVER_NAME"];
$pathpath = realpath("../../files/uploaded_file.jpg");
echo "You can link to the file using the following link... $server$pathpath";
?>
Unfortunately this produces the following...
www.example.com/home/fhlinux123/g/example.com/user/htdocs/ninja/base/files/1.doc
Whereas what I am after is as follows...
www.example.com/files/uploaded_file.jpg
I can't assume that the folder 'files' will always be in the same directory.