Page 1 of 1

untidy source code

Posted: Tue Jun 03, 2008 6:53 am
by justin2008
Please have a look of following codes

1.

Code: Select all

 
<div>
   <div>
      <!-- Main contents here -->
      <div>
         <div>
             <h1>Justin here !</h1>
             <p>This is sample paragraph statement </p>
         </div>
      </div>
      <!-- Main contents ends here -->
    </div>
</div>
 
When we take the source code after run this code in the browser, it shows neatly same as above ( correctly intended)

2.

If we create a new php file for the "Main content are of above code and it call inside other php script such as

Code: Select all

 
<div>
   <div>
      <!-- Main contents here -->
      <?php include("main_content.php"); ?>
      <!-- Main contents ends here -->
    </div>
</div>
 
When we take the source code after run this code in the browser, it shows untidy( tags are not properly intended) as below

Code: Select all

 
<div>
   <div>     
      <!-- Main contents here -->
<div>
 <div>
     <h1>Justin here !</h1>
     <p>This is sample paragraph statement </p>
 </div>
</div>
<!-- Main contents ends here -->
 
  
    </div>
</div>
 
What is the reason of this alignment issue? Anyone can help?

Re: untidy source code

Posted: Tue Jun 03, 2008 6:56 am
by vargadanis
Just a remark: we won't be able to help you with the intends unless you put your code into [ code ] tags (PHPBB code).

Re: untidy source code

Posted: Tue Jun 03, 2008 5:10 pm
by Weirdan
What is the reason of this alignment issue? Anyone can help?
There's no issue, actually =). main_content.php doesn't have that levels of indenting inside it, that's all. php won't indent something it includes since it doesn't care about indenting at all. Especially about indent levels of something outside of php tags (like your html).