|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
XHTML/PHP error
I'm working on the new design for the site i am workign on and have decided to have it follow XHTML specs. However when I tried to give the page a quick test It gives me a parse error on line 5. That is my XML declaration.
Code:
<?xml version="1.0" encoding="UTF-8"?> Is there any way around this without removing the XML declartion?
__________________
CHornJr "One day I'll know what I am doing" ![]() My Blog Suanhacky Lodge #49 Rebel Squadrons |
|
#2
|
|||
|
|||
|
Just off the top of my head you could echo it to the page as a true literal (that is enclosing it in single quotes) that way php won't try to parse it -
echo '<?xml version="1.0" encoding="UTF-8"?>'; Hope that helps, -KM- |
|
#3
|
|||
|
|||
|
1.
I suggest you write all your scripts with the <?php tags instead of <? 2. You will need to set a configuration variable in your php.ini or in .htaccess / httpd.conf php_value short_open_tag 0 Now php will recongnize <?xml is not php code and will not try to parse it.
__________________
__________________________________________________ _ Wil Moore III, MCP | Integrations Specialist | Senior Consultant Are You Listed...? | DigitallySmooth Inc. |
|
#4
|
||||
|
||||
|
I don't have access to the htaccess, php.ini or httpd.conf files however I will send a note to those who do.
I did try the echo the statement and it screwed with my CSS. So you can see what I mean go to http://www.suanhacky.org/TEST/template.php to see the site without the XML declaration. The go to http://www.suanhacky.org/TEST/template2.php to see it with the xml declartion |
|
#5
|
|||
|
|||
|
PHP Code:
|
|
#6
|
|||
|
|||
|
My mostly used solution to fix that:
PHP Code:
works fine with many of my rss/rdf-files ![]() |
|
#7
|
|||
|
|||
|
Quote:
Hello! I had the same problem and I solved using this solution! Thank You! Bye MauroMan |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Advanced Web Development > XHTML/PHP error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|