i’m having the following url for my test project on my local server:
http://localhost/projects/test/
now i’d like to have to have the possibilty of using this as root directory for eg. includes/images – like <img src='/img/test.jpg'> – this way it would save me a lot of time as i could simple put it online without any path modifications/flag.
any ideas how this could work?
thanks
I guess this is not a PHP related question, but more on HTML. You may look on the
<base>Tag. So instead of saying:<img src='/img/test.jpg'>go and make:
Which will in fact point to: http://localhost/projects/test/img/test.jpg
and for the PHP scripts use the set_include_path() function