Page 1 of 1

Relative paths

Posted: Tue Jul 27, 2010 11:54 am
by inka
Greetings!

I`m currently trying to make a webpage that is kinda based on a template, but I found a very big problem.
The pages include the header and the footer files.

The problem is when I try to create a folder and a page in it. I can change the include links for these pages but the header and footer files use realtive urls and in this subfolders none of those links or pictures work... :?

I quite new the programing and Php and I would be very grateful for a solution!
Thank you for your time and patience!

Re: Relative paths

Posted: Tue Jul 27, 2010 11:56 am
by Benjamin
Use a base url or absolute path.

Re: Relative paths

Posted: Tue Jul 27, 2010 12:10 pm
by inka
Benjamin wrote:Use a base url or absolute path.
Thank you about the tipp.

If I use a base url for the included files, which are mostly HTML, is there a way not to exit every time from html to php if I have a link?

Better way than this:

Code: Select all

<script type="text/javascript" src="<?php echo BASE_URL; ?> includes/dom-build.js"></script>
Thank you again!

Re: Relative paths

Posted: Tue Jul 27, 2010 12:34 pm
by Benjamin
Yes, you set the base url once, in the header.