Page 1 of 1

DOCTYPE prob

Posted: Fri Jan 11, 2008 10:55 am
by shiningtor
Hi

I have changed my server to enable webpages with html extensions to use PHP.

How do I display a webpage with this DOCTYPE (see below) because the browser now displays an error for the first line?

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

Thanks

Shiningtor

Re: DOCTYPE prob

Posted: Fri Jan 11, 2008 12:30 pm
by jimthunderbird
I have similar problem before.

Maybe just use php's print command:

print “<?xml version=”1.0″?>";

instead of write it directly in html

Hope this helps.

-- Jim

Re: DOCTYPE prob

Posted: Sat Jan 12, 2008 4:51 am
by deadoralive
look in your php.ini file for the short_open_tags setting. Change this to off and you shouldn't have any more problems

Re: DOCTYPE prob

Posted: Sat Jan 12, 2008 9:23 am
by feyd
deadoralive wrote:look in your php.ini file for the short_open_tags setting. Change this to off and you shouldn't have any more problems
One's code should be flexible enough to work whether short tags are enabled or not. Therefore printing the statement is better.

Re: DOCTYPE prob

Posted: Sun Jan 13, 2008 2:19 pm
by shiningtor
Many thanks for that.

Shiningtor :lol: