Basically I am working on a website that uses subfolders for example yourwebsite.com/foldername/index.php. This obviously causes issues when calling files with PHP so I am using
to call the include files which works fine.
The problem I am having is when it comes to calling the JS, CSS and images. How would I go about using something similar so when I source and image or file it starts straight from the root directory? Grateful for any help with this!
Code:
<?php
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
?>
The problem I am having is when it comes to calling the JS, CSS and images. How would I go about using something similar so when I source and image or file it starts straight from the root directory? Grateful for any help with this!







