owosso Posted December 10, 2010 Share Posted December 10, 2010 Normally I'd insert the Google Analytics code before the </body> tag.Where should I insert it in a php document? It has no closing body tag. Here's my final code in my index.php document: </div><!-- #content --> <?php require ($path_to_root . 'includes/foot.php'); // Include the footer HTML. NOTE: div#wrapper is closed in foot.php ?> Link to comment Share on other sites More sharing options...
[dx] Posted December 10, 2010 Share Posted December 10, 2010 I guess u have </body> in foot.php so try using it before <?php require($path_to_root ... Link to comment Share on other sites More sharing options...
gar onn Posted December 10, 2010 Share Posted December 10, 2010 in the amp of your index.php you'll have a folder 'includes' in that folder you should open 'foot.php'And in foot.php you'll find the end of the body tag Link to comment Share on other sites More sharing options...
Synook Posted December 11, 2010 Share Posted December 11, 2010 And if yu really don't have a closing body tag then your page is invalid and you should insert one Link to comment Share on other sites More sharing options...
owosso Posted December 11, 2010 Author Share Posted December 11, 2010 in the amp of your index.php you'll have a folder 'includes' in that folder you should open 'foot.php'And in foot.php you'll find the end of the body tagThanks Garr Onn. That's it! I found it! I appreciate your help so much! Link to comment Share on other sites More sharing options...
Dilated Posted December 11, 2010 Share Posted December 11, 2010 And if yu really don't have a closing body tag then your page is invalid and you should insert oneNot true. body's close tag, and start tag for that matter, can be omitted. Link to comment Share on other sites More sharing options...
gar onn Posted December 11, 2010 Share Posted December 11, 2010 Not true. body's close tag, and start tag for that matter, can be omitted.You should not omit the body tag if you're making any HTML page, same as the HTML tags... Link to comment Share on other sites More sharing options...
Synook Posted December 12, 2010 Share Posted December 12, 2010 Dilated is right, in SGML-based HTML the body tag (and some other tags) are implied and get, uh, inserted for you if you don't put them in. SGML will also assume closing tags if the situation is unambiguous.Of course, it's probably better if you put the tag in anyway . Link to comment Share on other sites More sharing options...
Dilated Posted December 13, 2010 Share Posted December 13, 2010 You should not omit the body tag if you're making any HTML page, same as the HTML tags...Why not? Less bandwidth, and the dom structure will end up with a <body> and <html> regardless.Synook, how is it better to use <body> and <html>? I mean, I suppose one of them might be necessary if you need an attribute on it, but otherwise they're not necessary.To the OP, I would say go either way. Either go without a <body> close tag and without the open tag as well, or use both tags. You don't need to, but it looks awkward with just the open tag. Link to comment Share on other sites More sharing options...
Synook Posted December 14, 2010 Share Posted December 14, 2010 I think it's just nicer - it makes your code more readable, in the same way that adding comments does, and when you do need to use them later, for attributes etc., you won't get confused (you never know). And it's a good habit to get into if you are going to be using XML-based languages at some time. Link to comment Share on other sites More sharing options...
Dilated Posted December 14, 2010 Share Posted December 14, 2010 And it's a good habit to get into if you are going to be using XML-based languages at some time.XML-based languages only require a single all-encompassing root element. XML-based languages wouldn't necessitate a <body> in comparison, maybe <html>, but not <body> or <head>. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.