I am implementing a php site that allows users to upload their pictures, I created the uploads directory at the same level as root but now how can I access those images in html. I tried following
<img src="../../uploads/<?=$filename?>">
I am implementing a php site that allows users to upload their pictures, I created the uploads directory at the same level as root but now how can I access those images in html. I tried following
<img src="../../uploads/<?=$filename?>">
Try making a root variable
If you are using php 5.3+
<?php
$root = __DIR__;
?>
<img src="<?php echo $root ?>uploads/<?=$filename?>">
or set the $root variable to your domain name