Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XHTML HEADERS

Status
Not open for further replies.

PrimordialJackson

Programmer
Aug 9, 2005
3
GB
Trying to create my first XHTML STRICT template in php and keep failing with a fatal error on line 1:

<?xml version="1.0" encoding="utf-8"?>

What on earth am I doing wrong? I'm very embarrased getting stuck on line 1, know it's gonna be something really daft. Any help would be appreciated.

Cheers ...
 
Ooops - forgot to mention the page errors with ...

Parse error: parse error, unexpected T_STRING in /home/charlesj/public_html/tpl/overall_header.tpl on line 1

 
You are using PHP?

The PHP parser on your server thinks that line is PHP as it starts with a <?


Try this instead.
Code:
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>

The offending characters are "escaped" so PHP doesn't try to parse them.

Foamcow Heavy Industries - Web design and ranting
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
I wonder what possesses people to make those animated gifs. Do you just get up in the morning and think, "You know what web design r
 
Hi Foamcow,

I've been smoking to much!!!

All working fine now - just nice to see the W3C validation.

Thanks for your help.

Cheers ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top