Problem with ssi

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
darren713
Forum Newbie
Posts: 5
Joined: Tue May 27, 2008 1:38 am

Problem with ssi

Post by darren713 »

I have a problem with my SSI.
Although i run the command to attach it and as you'd expect

Code: Select all

<?php require_once('includes/header.php'); ?>
works as in adding the page. However although my images and css works within my header document. it seems that it does not work at all within the page calling the header document.

Here is what i got..
Header.php with the css link

Code: Select all

<link href="../stylesheets/public.css" rel="stylesheet" type="text/css" />
and the images

Code: Select all

<img src="../images/dhwd-logo.png" alt="" align="left" />
. which like i said works fine within the header. but when i call it with my content.php there is not css formatting and no images.
Can this have anything to do with the content.php and header.php in different folders in the directory?
or can this be something else like apache not recognizing it?

I am using the latest version of Wamp for my php,mysql, and apache
on a windows vista pc
editor is dreamweaver cs3

Thanks in advance
darren713
Forum Newbie
Posts: 5
Joined: Tue May 27, 2008 1:38 am

Re: Problem with ssi

Post by darren713 »

sorry for wasting time and bandwidth but i have just worked it out.

in my directory my content is in the root of the site and my header is in a folder called includes.
i made a folder called stylesheets and my public.css document is placed in there.
my images are in my images folder also. So when i linked my header to the css and images i was linking it to the path of the header file leading into the includes folder. However my content.php is in the root.

Path that did not make it work. example.

Code: Select all

<link href="../stylesheets/public.css" rel="stylesheet" type="text/css" />
 
Now this is what confuses me. this is how i got it to work

Code: Select all

<link href="stylesheets/public.css" rel="stylesheet" type="text/css" />
 
Can anyone explain how this is possible? because i thought if i was using an ssi the css and images would link into the includes folder directly to the header file rather than the root. Now when i check the header.php in dreamweaver. it has no style. when i check the content.php its completely fine.
Post Reply