Hey,
Hope someone can help we with this I have searched the net for hours now and found no luck.
I basically want a way of referring to the website's root dir - from which I can provide links to the files I want to reference from anywhere on my site at any level.
The problem:
On each page of my site I start a script with:
require("includes/inc_functions.php");
Ok, all well and good, however in the file 'inc_functions.php' I have this line of code:
$imagePathSource = "images/thumbnail/".$_SESSION['memberImg'];
---> I want to alter this line above to something like:
$imagePathSource = "myWebsiteRoot/images/thumbnail/".$_SESSION['memberImg']; So that I can include this functions file anywhere on my site and I always refer to this same image folder correctly. Hope that makes sense.
I have tried
$_SERVER['DOCUMENT_ROOT']."/images/thumbnail etc
...and no luck, I simply get thrown a URL such as:
mydomain.com/serverFile/file/serverFile/mydomain.com/images/thumbnail/ !!!!
I have also tried simply using "/images/thumbnail" - With a single slash to start off -I have read many a place that this should refer to the site root automatically, but again no luck.
Any help would be appreciated. Thanks.