1 (edited by scottywz 2005-07-02 02:31)

Topic: An Easier Way to Put in a DOCTYPE

As you may know, the DOCTYPE is MANDATORY (eg. in X/HTML, MathML, SVG, etc.).

However, it's hard to remember all thw ways to put it into a Web page.

So, I made the ScottyWZ.COM DTD PHP Function. It only takes 2 lines of PHP code:

<?php

include "dtdf.php";
write_dtd();

or

<?php

include "dtdf.php";
write_dtd("DOCTYPE")

where DOCTYPE is the abbreviation for the DTD you want to use. These abbreviations are located in the script itself and readme.txt. If the DOCTYPE you want to use isn't listed, you can add it.

Get it here:
.tar.gz
or
.zip

Enjoy!

P.S. I've gotten it to work in PunBB. In fact, that's how I tested it.

Re: An Easier Way to Put in a DOCTYPE

thanks for sharing ~~~ wink

Re: An Easier Way to Put in a DOCTYPE

isn't it easier just to copy and paste the doctype when you want it? this way you need to copy and paste the php and the include...

4 (edited by scottywz 2005-07-05 03:52)

Re: An Easier Way to Put in a DOCTYPE

Well, OK. Now, if you have an app you're making, you can just put the include in a file that has all these other includes. Then just type write_dtd(); or whatever. Look at PunBB. That includes two things a file. smile

Re: An Easier Way to Put in a DOCTYPE

maybe, you you still have to put

include "dtdf.php";
write_dtd("DOCTYPE")

and since you probably don't remember the shorter code for your doctypes you need too look that up, when you could have just pasted the doctype straight in

6 (edited by GregK 2005-07-05 16:28)

Re: An Easier Way to Put in a DOCTYPE

All of mine are xhtml1.0strict & never change?

would be much more useful for stylesheets IMO.

Re: An Easier Way to Put in a DOCTYPE

You don't use DOCTYPEs in CSS.

Some may find a use of this, though.

Re: An Easier Way to Put in a DOCTYPE

Exactly how dynamic does the DOCTYPE have to be?