Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 22-11-04
drivetowin's Avatar
Driving to win
 
Join Date: Aug 2003
Location: If I'm not at home, I'm in hospital
Posts: 7,363
Thanks: 5
Thanked 8 Times in 5 Posts
drivetowin seems to know their stuff
  PHP/XML question

Hi

I'm having a Monday morning senile moment

I'm trying to process an XML file using PHP and its all working fine except for a field containing a deeplink url which is of the form http://xxx.com/?a=xxx&b=xxx&c=xxx

My guess is the reason its not working is that the XML parser is seeing the = and thinking that they are field,value pairs within the XML string when I just want it to pass me back the whole field.

What do I need to do to get it to do this - I'm sure I've encountered and solved this in the past but this morning I just cannot get my mind around it.

Thanks

Keith
__________________
Never argue with idiots. They just drag you down to their level and then beat you with their experience.

If ignorance is bliss then some of the people I know must be orgasmic.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 22-11-04
Super Moderator
 
Join Date: Aug 2003
Posts: 2,451
Thanks: 0
Thanked 0 Times in 0 Posts
Rich is an unknown quantity at this point
It could be its invalid XML, try opening it directly with IE and see if it can parse it.

I think it could be the &'s that are causing the problem as I think the need encoding to & amp ; unless they are in a CDATA value.

If you are loading the xml into a string before parsing it, you could try doing a str_replace/preg_replace first to change the characters to something that you can then change back later.

If you're using PHP5 the simplexml functions are good for processing xml files. You probably won't want to change your parser due to having to change other parts of the script, but it will give you friendly(ish) errors if the xml is invalid (just try $xml=simplexml_load_file($location-of-xml-file); and it will give you some warnings if there are problems)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

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


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7