View Full Version : Linking to style sheets from web host
srule_
07-24-2007, 02:23 AM
Hey, how do i do the following:
I have all my main pages (style.css, index.htm, about.htm, ect..) in the main folder of my derctory.
I then have a folder called "articles" with all my articles in it.
The problem is the anything in the folder "aricles" does not link to my style sheet or any images in my image folder.
How do i do this?
oracleguy
07-24-2007, 02:29 AM
Sounds like you need to do:
/images/myimage.jpg
Instead of:
images/myimage.jpg
The slash indicates that it is from the root of the site and not in the current folder.
srule_
07-24-2007, 04:57 AM
Thanks, Adding the slash worked to get to my main derectory, but does not work when i try to get to my includes folder.
I the file i am getting the error with is in articles folder, and i am trying to get stuff from my includes folder to display in it.
i get the following error:
Warning: main(/includes/header.php) [function.main]: failed to open stream: No such file or directory in /home/www/nrtdesigns.com/html_resources/cssgallery.php on line 16
Warning: main() [function.include]: Failed opening '/includes/header.php' for inclusion (include_path='.:/usr/local/php4/lib/php') in /home/www/nrtdesigns.com/html_resources/cssgallery.php on line 16
_Aerospace_Eng_
07-24-2007, 08:41 AM
I use this on my sites
include($_SERVER['DOCUMENT_ROOT'].'/includes/header.php');
srule_
07-29-2007, 08:11 PM
Thank you, that works great.
croatiankid
07-29-2007, 09:04 PM
By the way, you can also use the BASE tag.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.