Getting duplicate tags in output code

Permalink 1 user found helpful
I created a special default template and it worked fine on my localhost, this is the code I used.
<?php 
defined('C5_EXECUTE') or die("Access Denied.");
$this->inc('elements/header.php'); ?>
   <div id="central">
       <div id="left-sidebar">
         <?php 
         $as = new Area('Sidebar');
         $as->display($c);
         ?>      
      </div>
      <div id="body">   
         <?php 
         $a = new Area('Main');
         $a->display($c);
         ?>

Once uploaded to the server it created duplicate <div id="body"> tags that go something like this...
<div id="body">
<div id="body">
the content of the page here...
</div>
</div>

The only thing that corrected it was to remove the tags in the code like thus...
<?php 
defined('C5_EXECUTE') or die("Access Denied.");
$this->inc('elements/header.php'); ?>
   <div id="central">
       <div id="left-sidebar">
         <?php 
         $as = new Area('Sidebar');
         $as->display($c);
         ?>      
      </div>
         <?php 
         $a = new Area('Main');
         $a->display($c);
         ?>
      <div id="right-sidebar">

It's kind of an offensive fix and I wouldn't mind knowing where the extra code block is coming from.

scorpa54
 
Steevb replied on at Permalink Reply
Steevb
Hello and Welcome,

Not quite sure on your duplicate tags, but a body tag is normally under header tag wrapping most things. Also giving the body tag an id or class is not good.

Try giving inner content a different name: 'content', 'inner' or 'middle' and then obviously change your CSS to suit.

That should work.
scorpa54 replied on at Permalink Reply
scorpa54
Thank you, I am definitely going to try that as on having a look around I discovered that it was only doing that on the first 2 pages, so my "fix" left out any styling after that. :(

Update:
Gave that a try and, low and behold, it duplicated the "content" tags.
Further inspection and I discovered that the extra tags were coming in from doing a copy/paste of the content from my localhost site. Boy do I feel foolish now.