Hi there. You guys are going to save my life.
I've recently started changing a site from plain ol' html to php, so that I can use includes for headers, footers and so on, and also so that in the future dynamically creating pages won't be a problem.
I have includes working a-okay at the moment for files in the root directory, i.e. in http://buddingpress.co.uk/sitemap.php I have three functional includes, all basically using the code:
The problem is that I want to use includes for pages in subdirectories, i.e. http://buddingpress.co.uk/contact/index.php – but the darn thing just doesn't work the same. Inserting a slash, as you might with an image or href or whatever, doesn't seem to work. It actually sends the whole thing berserk.
So is there a nice, attractive fix? Or do I have to just direct the includes by using an entire url, including the http://? I'm sure this is a php basic that I'm just ignorant of.
Thanks for reading!
I've recently started changing a site from plain ol' html to php, so that I can use includes for headers, footers and so on, and also so that in the future dynamically creating pages won't be a problem.
I have includes working a-okay at the moment for files in the root directory, i.e. in http://buddingpress.co.uk/sitemap.php I have three functional includes, all basically using the code:
Code:
<?php include("includes/footer.php"); ?>
So is there a nice, attractive fix? Or do I have to just direct the includes by using an entire url, including the http://? I'm sure this is a php basic that I'm just ignorant of.
Thanks for reading!
Comment