PDA

View Full Version : php include question


nick_a
12-06-2002, 06:57 PM
Im working on my site http://www.nextstopnowhere.net/test/main.php
and I am implementing some php include funtions to bring in parts of my site. This is my first time trying to load things dynamically this way. I am having some problems with alignments though. Most everything works but there is some wierdness. If you view the site you can see what Im talking about. Does anyone see anything wrong with my code http://www.nextstopnowhere.net/test/code.txt ? You can figure out the php files Im loading in by looking at the source if you need to look at them (maybe they are set up wrong?). Id appreciate any advice. And is there any good tutorials available?... so I can try to understand the includes.
Thanks Alot!
- Nick

nick_a
12-06-2002, 07:00 PM
also to add something... when a php file is loaded it inserts all of the HTML info from the header. Is this right? By the way... I created the page and all of the pages that load in in DW and saved them as php files. Could that cause a problem?

duniyadnd
12-08-2002, 06:43 PM
you only need one set of <body> and <head> tags in the whole page. Remove the excess ones from your included pages.

That might have caused the alignment differences.

Duniyadnd

Kiwi
12-08-2002, 07:17 PM
Basically, the same answer. You need to sort out your included pages properly. You want to deliver a final html that is well-formed: ie has only one html, head and body tag (plus everything else should be correct).

One trick is to view your page source and run it through the w3c validator. Then you will get an idea of what the problems are.

Get all of your 'head' content included in one head section. Then all of the body content in one body section.

nick_a
12-09-2002, 12:00 AM
thanks :)