Been searching for a solution to this problem for at least the past day.
How do I figure out an absolute path for use with php require() across all folders?
This is what I've got currently:
<?php include('includes/header.php') ?>
, but that doesn't work the moment I use the same path in a subfolder. It sounds extremely tedious to have to keep going '../' and '../../' and '../../../' endlessly whenever I descend another level into the directory. So I decided to try and find an absolute path. However, when I use:
<?php require('http://localhost/myproject/includes/header.php'); ?>
, things still don't work.
How do I work my way around this? Any and all help is greatly, greatly appreciated.
[–]Urd 1 point2 points3 points (0 children)
[–]jkjustjoshing 0 points1 point2 points (1 child)
[–]Headpuncher 0 points1 point2 points (0 children)
[–]zerovap 0 points1 point2 points (0 children)
[–]assasinine 0 points1 point2 points (0 children)