is there anyway to explicitly declare the path to a directory as a constant which can be used to easily point to it instead of using ../../ until you reach the root dir.
echo "<img src=" . $image_dir . "image.jpg/>" or something...
thanks
declaring directories as constants
Moderator: General Moderators
- aaronhall
- DevNet Resident
- Posts: 1040
- Joined: Tue Aug 13, 2002 5:10 pm
- Location: Back in Phoenix, missing the microbrews
- Contact:
Code: Select all
<?php
define('ROOT_DIRECTORY', '/path/to/public/dir/');
echo '<a href="' . ROOT_DIRECTORY . 'subdir/file.php">file</a>';
?>