Current location: Hot Scripts Forums » Programming Languages » PHP » XML causes PHP parse error

XML causes PHP parse error

 
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 08-06-08, 10:30 PM
greenpig greenpig is offline
Newbie Coder
 
Join Date: Aug 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
XML causes PHP parse error

Hi, I'm new to this site and relatively new to PHP, so my apologies if this has been answered before (a quick search of the forum didn't turn up anything).

I code my web pages in XHTML and they all start:

HTML Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
I want to parse these pages for PHP, but when I do the first of these lines throws up an "unexpected T_STRING" parse error. A look at phpinfo() showed me that "short_open_tag=on" by default on my hosting service. So I created a custom php.ini file that sets short_open_tag=off, and now phpinfo() confirms that short tags are off. However I'm still getting the same parser error:

Parse error: syntax error, unexpected T_STRING in [URL] on line 1

I know it is possible to work around this problem by wrapping the offending line in a <?php echo ... ?> command, but this breaks the syntax checker in BBEdit, where I do my coding. Does anyone have any ideas what else might be causing the parser to choke on this line?

Thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Parse error: syntax error p51d78th PHP 3 01-02-08 09:52 AM
xml to mysql using php - urgent mianriz PHP 1 12-21-06 04:51 PM
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING o danielta PHP 2 07-11-06 01:12 PM
Parse error: parse error, unexpected $ in... keefermedia PHP 4 04-23-06 12:21 PM
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE | help? culticka PHP 1 11-25-04 04:10 PM


All times are GMT -5. The time now is 10:28 PM.
vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.