Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Code Generator & an interesting problem with IE6

 

 


mel
User

May 31, 2008, 10:53 AM

Post #1 of 2 (500 views)
Shortcut
Code Generator & an interesting problem with IE6 Can't Post

Hi Dave,

Had an interesting hour or so today trying to track a problem down in IE6

All layout in Firefox using auto margins worked just fine as usual but forgot to check in IE6 but when I did everything was to the left of the screen ooops

Looked back at a couple of my old sites that had not used CMS but had used wrappers with auto margins to see if I had made a mistake - nothing obvious there

But the only real difference between the old sites and the one I am working on is the code generator in CMS and in particular this bit below that code generator produced

<?php echo "<?xml version='1.0'?>\n"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

As soon as you take out the echo statement normal service is resumed - all wrappers neatly in the center of the page where they are supposed to be

As for the data all seems to be displaying as I want it to

So - are there any potential problems in leaving the echo statement out and from an interest point of view what does it do?

Thanks Mel


Dave
Staff / Moderator


May 31, 2008, 12:07 PM

Post #2 of 2 (498 views)
Shortcut
Re: [mel] Code Generator & an interesting problem with IE6 [In reply to] Can't Post

Hi Mel,

I think you're totally fine to just remove that line if it's causing problems. Actually the only code you need from the code generator is the Step1, Step2, etc code, and something a meta charset tag.

The echo statement just prints this: <?xml version='1.0'?>
Which encouraged but not required by the W3C for well formed XHTML documents. Search http://www.w3.org/TR/xhtml1/ for "xml version".

The reason why it's in a PHP tag is some installs of PHP are configured to run php code in tags like this <? echo "hello" ?> and so when they see <?xml version='1.0'?> they run it as PHP code and generate an error. So we put it inside a PHP tag to guarantee it won't generate an error.

I haven't heard of that affecting how browsers render the page though. Usually whether or not you have the <!DOCTYPE ... > tag will put the browser in a different render mode (called "quirks mode") or not which will affect that. But other than that I'm not sure.

In any case, all that extra code is optional so you're safe to remove it. Let me know if there's anything else I can do to help! :)

Dave Edis - Senior Developer
interactivetools.com

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4