try changing the code to <?php include('header.shtml'); ?>
try changing the code to <?php include('header.shtml'); ?>
[Jasme Library (Javascript Motion Effects)] My Site
/\/\@§†ê® §©®¡þ† /\/\@|{ê®
There are 10 kinds of people in the world, those that understand binary and those that don't.
yes, the long form always works better. You may also try an absolute path instead of a relative path:
PHP Code:
<?php
include($_SERVER['DOCUMENT_ROOT'].'/absolute/path/to/header.shtml');
// OR, depending on your PHP version / options:
// include('http://www.yoursite.com/absolute/path/to/header.shtml');
?>
Yes, but also there was a semicolon missing in his script.
[Jasme Library (Javascript Motion Effects)] My Site
/\/\@§†ê® §©®¡þ† /\/\@|{ê®
There are 10 kinds of people in the world, those that understand binary and those that don't.
Thanks for your help with all this,
In my way of thinking the part where i am going wrong is where to upload the header.shtml to.
If the header.php is in the includes folder where should i place the header.shtml file?
whoops - didn't catch that.
Practically speaking, you can put it wherever you like. What you have to double-check is that your include() function correctly points to it.Originally Posted by terriers33
If it's in the same folder as the include.php file, than just<?php include('header.shtml'); ?>
is fine.
If it's in a subfolder, then you need to write<?php include('subfolder/header.shtml'); ?>
.
In general, I prefer absolute or server-relative urls, like those I suggested above.
If it's in the same folder as the include.php file, than just <?php include('header.shtml'); ?> is fine.
That is what i have done but no luck
http://moe.enixns.com/~manchest/picKLE/index.php
This will not be my real address when this problem is sorted out
After many hours, and all your help i have found the answer to my issue.
The index.php code shows
include("./picKLE-includes/header.php");
I replaced it with
include("picKLE-includes/header.shtml");
But still one problem.... the header is there showing up but without the style sheet???
Sorry!
Understand that PHP includes ONLY get the exact code inside the second page and place it into the first page. Any problems with stylesheets, layout, etc., are a problem with the html, not with the include. You must figure out what is wrong with the html, then how to fix it on the two pages.
The stylesheet probably isn't included in the main page's head section, since that's where it needs to be added as a tag.
Thus you have found one of the main problems using includes: placing one part in two places in the code.
The solution is to include two parts, or just hard-code the stylesheet into the top. Alternatively you could set up a complex system where you have an include with two parts as variables, then output one in the head section and one in the body; but that is complex and more work than just doing it separately. Basically, that's moving on toward a template setup, which would be useful if you were doing more than just a simple include.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
terriers33 (10-08-2009)
I am not quite sure its a stylsheet issue...thats what i did think.
Could it be the header images???
If you could check these two images
One is my header that works fine on the other shtml pages, abut us etc.
The other is how the header shows up on the picKLE index.php page.
Thanks.
Bookmarks