This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > April 2004 > Include having problems?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Include having problems?
spottedhaggis

2004-04-04, 10:30 pm

Hi all.

Thanks to the person that suggested I use include in my PHP to call a header
and footer, it sort of works and I can see the real benefit to it when I
have alot of pages.

I am however having a problem.

The header and footer files, including the script for the menu are located
in a sub folder inside the root folder, also in the root folder in another
sub folder are the menu images.

The PHP file I am placing the include file is some 3 directories inside the
root, and I am getting a streaming error message, as seen here

http://www.ifseurope.net/technical/kb/index.php

At first I tried the following for path in include ../home/header.htm but
this did not show anything but database style errors, so I removed the ..
and still no good, now I have a direct htm link as
http://www.ifseurope.net/home/header.htm and not the menu comes up (though
there appears to be a large gap between the header and the data) but I get
the following error

Warning: main(): stream does not support seeking in
/usr/local/4admin/apache/vhosts/ifseurope.net/httpdocs/technical/kb/index.ph
p on line 2

I get the same error with the footer as well?

Can anyone assist me with this, am sure its something simple.


spottedhaggis

2004-04-04, 10:30 pm

ok, I have supressed the erros now as the page works with or with out these
errors, would like a fix, however its temp resolved.

Thanks for any assistance anyway,

"spottedhaggis" <craigkennedy@blueyonder.co.uk> wrote in message
news:eY%bc.21736$Id.12856@news-binary.blueyonder.co.uk...
> Hi all.
>
> Thanks to the person that suggested I use include in my PHP to call a

header
> and footer, it sort of works and I can see the real benefit to it when I
> have alot of pages.
>
> I am however having a problem.
>
> The header and footer files, including the script for the menu are located
> in a sub folder inside the root folder, also in the root folder in another
> sub folder are the menu images.
>
> The PHP file I am placing the include file is some 3 directories inside

the
> root, and I am getting a streaming error message, as seen here
>
> http://www.ifseurope.net/technical/kb/index.php
>
> At first I tried the following for path in include ../home/header.htm but
> this did not show anything but database style errors, so I removed the ..
> and still no good, now I have a direct htm link as
> http://www.ifseurope.net/home/header.htm and not the menu comes up (though
> there appears to be a large gap between the header and the data) but I get
> the following error
>
> Warning: main(): stream does not support seeking in
>

/usr/local/4admin/apache/vhosts/ifseurope.net/httpdocs/technical/kb/index.ph
> p on line 2
>
> I get the same error with the footer as well?
>
> Can anyone assist me with this, am sure its something simple.
>
>



Alan

2004-04-04, 10:30 pm

on the images and links that are IN the header and footer-
Use either full absolute http:// paths, or site root relative paths.
Don't use Document Relative paths, they will be wrong when the include is
used in different folder levels.

for instance, one of the buttons is here-
http://www.ifseurope.net/mainmenuim...eader_r2_c2.jpg
site root relative path would be
/mainmenuimages/ifsheader_r2_c2.jpg

***
If you want to quickly change links to a different linking method- install
the Relativity Extension.
http://e7x.com/dw/ Relativity ext.
or here
http://www.microwaved.plus.com/dw/
***

On the streaming error, i don't see that in the page or code for those two
links. I do see that the contains THREE complete html documents in it's
source, each with full sets of <html><head><body> and so on.

the include page should only contain what's valid html for where it's going
to be used-

and, a .php page should not have this at the top-
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>

Also, if you use PHP inside of the header or footer includes, should give
them .php file extensions. (if you are using php- I'm not sure if there is
serverside stuff there)

Gary White

2004-04-04, 10:30 pm

On Sun, 4 Apr 2004 23:25:50 +0100, "spottedhaggis"
<craigkennedy@blueyonder.co.uk> wrote:

>The header and footer files, including the script for the menu are located
>in a sub folder inside the root folder, also in the root folder in another
>sub folder are the menu images.



Make the links site root relative. For the images and for hyperlinks to
other pages within the site, you just begin the link with the slash
character:

<img src="/images/imagename.gif">
<a href="/somedirectory/somefile.php">

The include directive uses the server's actual file system, not the
virtual directory where the site is stored, so you need to account for
that:

include $_SERVER['DOCUMENT_ROOT']."/include/header.php";


Gary
Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews