Advanced Web Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignAdvanced Web Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 18th, 2003, 01:07 AM
CHornJr's Avatar
CHornJr CHornJr is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: New York City
Posts: 236 CHornJr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 50 m 36 sec
Reputation Power: 7
Send a message via AIM to CHornJr Send a message via MSN to CHornJr Send a message via Yahoo to CHornJr
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?
Attached Files
File Type: zip chornjr_xhtml_php_error.zip (1.7 KB, 419 views)
__________________
CHornJr
"One day I'll know what I am doing"
My Blog
Suanhacky Lodge #49
Rebel Squadrons

Reply With Quote
  #2  
Old September 18th, 2003, 05:29 AM
kode_monkey kode_monkey is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 367 kode_monkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 21 sec
Reputation Power: 6
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-

Reply With Quote
  #3  
Old September 18th, 2003, 07:29 AM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 788 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 7
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.

Reply With Quote
  #4  
Old September 18th, 2003, 03:26 PM
CHornJr's Avatar
CHornJr CHornJr is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: New York City
Posts: 236 CHornJr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 50 m 36 sec
Reputation Power: 7
Send a message via AIM to CHornJr Send a message via MSN to CHornJr Send a message via Yahoo to CHornJr
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

Reply With Quote
  #5  
Old September 18th, 2003, 05:34 PM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 788 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 7
PHP Code:
 I don't have access to the htaccess, php.ini or httpd.conf files however I will send a note to those who do. 
Thats too bad. I'm sorry to hear that.

Reply With Quote
  #6  
Old November 21st, 2003, 02:12 AM
Minots Minots is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Geo.: 50.6491;6.7904
Posts: 1 Minots User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
My mostly used solution to fix that:
PHP Code:
print ("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"); 


works fine with many of my rss/rdf-files

Reply With Quote
  #7  
Old July 25th, 2006, 11:29 AM
MauroMan MauroMan is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 1 MauroMan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 20 sec
Reputation Power: 0
Quote:
Originally Posted by Minots
My mostly used solution to fix that:
PHP Code:
print ("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"); 


works fine with many of my rss/rdf-files


Hello! I had the same problem and I solved using this solution!

Thank You!

Bye
MauroMan

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignAdvanced Web Development > XHTML/PHP error


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT