Jump to content

Haighy

Members
  • Posts

    27
  • Joined

  • Last visited

Haighy's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. ......or could it be my IE interpreting it better than my host server because i see </ a7 voucherTypeId> when i do a print as mentioned
  2. Hi XSLT S I dont think it is that - please check out the source xmlhttp://api.tradedoubler.com/1.0/vouchers.XML;voucherTypeId=1?dateOutputFormat=iso8601?token=248487FBCA39B156B569D8F698C83FF27503CE8F looks ok to me
  3. using htmlspecialchars: <voucherList><voucher><id>9706</id><programId>898</programId><programName>Tesco.com</programName><code>TD-PRGM</code><updateDate>1356965680759</updateDate><startDate>1356908400000</startDate><endDate>1357513199999</endDate><title>5 off £30 on any Pre Order Games</title><shortDescription>5 off £30 on any Pre Order Games until 06.01.13 using code TD - PRGM (Offer ends 06.01.13. Excludes </shortDescription><description>5 off £30 on any Pre Order Games until 06.01.13 using code TD - PRGM (Offer ends 06.01.13. Excludes sellers)</description><voucherTypeId>1</voucherTypeId><defaultTrackUri>http://clk.tradedoubler.com/click?a(2075091)p(898)ttid(13)url(http://www.tesco.com/direct/gaming/pre-orders-games/cat15940025.cat?icid=ents_main_slot3 )</defaultTrackUri><siteSpecific>false</siteSpecific><landingUrl>http://www.tesco.com/direct/gaming/pre-orders-games/cat15940025.cat?icid=ents_main_slot3 </landingUrl></voucher><voucher><id>8255</id><programId>122698</programId><programName>Mothercare</programName><code>E4HD</code 3ff>< updateDate>1353600101304</updateDate><startDate>1353538800000</startDate><endDate>1369259999999</endDate><title>Deal's Week - Maclaren Techno XT</title><shortDescription>Deal of the Week - Maclaren Techno XT </shortDescription><description>This offer is valid on selected lines only (U0544, U1308, U1309, U3060, U0530), whilst stocks last. This offer cannot be used in conjunction with any offer/voucher code. Offer ends Monday 26th November 2012</description><voucherTypeId>1</voucherTypeId><defaultTrackUri>http://clk.tradedoubler.com/click?a(2075091)p(122698)ttid(13)url(http://www.mothercare.com/Maclaren-Techno-XT-Stroller---2012/LU1308,default,pd.html )</defaultTrackUri><siteSpecific>false</siteSpecific><landingUrl>http://www.mothercare.com/Maclaren-Techno-XT-Stroller---2012/LU1308,default,pd.html </landingUrl></voucher><voucher><id>2691</id><programId>2973</programId><programName>Lensway</programName><code>NEWLWC</code><updateDate>1345842074436</updateDate><startDate>1345759200000</startDate><endDate>1 3fe 361746799999</endDate><title>12% off Contacts+Free Delivery</title><shortDescription>New Customers get 12% off plus free Delivery for their first contact lens order from LensWay.co.uk</shortDescription><description>**New Customers** get 12% off plus free Delivery for their first contact lens order from LensWay.co.uk.; http://www.lensway.co.uk/contact-lenses</description><voucherTypeId>1</voucherTypeId><defaultTrackUri>http://clk.tradedoubler.com/click?a(2075091)p(2973)ttid(13)url(http://www.lensway.co.uk/contact-lenses)</defaultTrackUri><siteSpecific>false</siteSpecific><landingUrl>http://www.lensway.co.uk/contact-lenses</landingUrl></voucher><voucher><id>2688</id><programId>2973</programId><programName>Lensway</programName><code>RAYBAN</code><updateDate>1345841667876</updateDate><startDate>1345759200000</startDate><endDate>1361746799999</endDate><title> Complete Ray Ban Glasses £79</title><shortDescription>Starting at only £79 shop over 80 styles of Ray Ban glasses. Lenses & delivery included.</ 3fb shortDescription><description>Starting at only £79 shop over 80 styles of Ray Ban glasses. Lenses & delivery included.; Shop Ray Ban Glasses: http://www.lensway.co.uk/glasses/brands/ray-ban/cRayBanFrames-p1.html'>http://www.lensway.co.uk/glasses/brands/ray-ban/cRayBanFrames-p1.html;< /description><voucherTypeId>1</voucherTypeId><defaultTrackUri>http://clk.tradedoubler.com/click?a(2075091)p(2973)ttid(13)url(http://www.lensway.co.uk/glasses/brands/ray-ban/cRayBanFrames-p1.html)</defaultTrackUri><siteSpecific>false</siteSpecific><landingUrl>http://www.lensway.co.uk/glasses/brands/ray-ban/cRayBanFrames-p1.html</landingUrl></voucher><voucher><id>657</id><programId>81570</programId><programName>Microsoft Store UK</programName><code>WINDOWS35OFF</code><updateDate>1338298986356</updateDate><startDate>1338242400000</startDate><endDate>1369864799999</endDate><title>35% OFF Windows7</title><shortDescription>Promo code enabling 35% off all Windows 7 products.</shortDescription><description>Promo code enabling 35% off all Windows 7 products.</description><voucherTypeId>1</ a7 voucherTypeId><defaultTrackUri>http://clk.tradedoubler.com/click?a(2075091)p(81570)ttid(13)</defaultTrackUri><siteSpecific>false</siteSpecific></voucher></voucherList>
  4. Bumping this up as I really need the help here
  5. i have noticed that -1;-1;-1 and 3ff appears regularly - is this decoded xml elements?
  6. [/code] ok here is everything url: http://api.tradedoubler.com/1.0/vouchers.XML;voucherTypeId=1?dateOutputFormat=iso8601?token=248487FBCA39B156B569D8F698C83FF27503CE8F sample from print $TDResponse Tesco.comXMASTREAT13552454444571355180400000135699479999915% off F&F Limited Edition collection15% off F&F Limited Edition collection1http://clk.tradedoubler.com/click?a(2075091)p(898)ttid(13)url(http://www.clothingattesco.com/)falsehttp://www.clothingattesco.com/293718710hmvWQ2013464115928101346364000000135699479999920% off selected pre-orders20% off when yo 3ff u pre-order any one of the listed titles1http://clk.tradedoubler.com/click?a(2075091)p(18710)ttid(13)url(http://hmv.com/hmvwe...-1&pPageID=5701)falsehttp://hmv.com/hmvweb/navigate.do?ctx=1000;-1;-1;-1;-1&ctx=-1;5;-1;-1;-1&pPageID=5701293618710hmvPE2513464115474881346364000000135699479999925% off selected chart CD's25% off selected chart CD's enter code PE25 at checkout1http://clk.tradedoubler.com/click?a(2075091)p(18710)ttid(13)url(http://hmv.com/hmvwe...ch.do?ctx=1000; 3ff -1;-1;-1
  7. I do get data so that's what is confusing me. It seems that the XML parser can't interpret it though
  8. the more i read about this, it must be something to do with the decoding. I dont want to convert to JSON at this point. Does anyone have any ideas?
  9. i have compared the $TDResponse between my test pc and the web host and both look identical - therefore am still puzzled why one works and not the other. could be something to do with the xml header? <?xml version="1.0"?> i have similar xml structures which are correctly parsed (using the same technic) but have a slightly different xml header?xml version="1.0" encoding="UTF-8"?>
  10. if i do print $TDResponse - no xml structure is shown - is that expected? never checked before
  11. i also ran $TDurl in IE <?xml version="1.0"?>-<voucherList>-<voucher><id>9142</id><programId>898</programId><programName>Tesco.com</programName><code>XMASTREAT</code><updateDate>1355245444457</updateDate><startDate>1355180400000</startDate><endDate>1356994799999</endDate><title>15% off F&F Limited Edition</title><shortDescription>15% off F&F Limited Edition collection</shortDescription><description>15% off F&F Limited Edition collection</description><voucherTypeId>1</voucherTypeId><defaultTrackUri>http://clk.tradedoubler.com/click?a(2075091)p(898)ttid(13)url(http://www.clothingattesco.com/)</defaultTrackUri><siteSpecific>false</siteSpecific><landingUrl>http://www.clothingattesco.com/</landingUrl></voucher>
  12. Hi All I have a bizzar issue which is driving me nuts. I was running a php server on my pc to test my code with no issues - now moved it to the host server and get this issue when try to parse xml: Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : Start tag expected, '<' not found in /websites/123reg/LinuxPackage22/tr/ad/in/tradingbay.co/public_html/Lib/Functions.php on line 154 here is my code: $TDurl = "http://api.tradedoubler.com".$Version.$module.$Format.$TDParams.$Token;print $TDurl;$TDResponse = @file_get_contents($TDurl);$TDParsed_Xml = simplexml_load_string($TDResponse);
  13. actually have found the solution thanks to your kind assistence i used this inside the foreach $NodeCount = $current ->count(); thanks again
  14. ahh sorry - I understand now. I did not see this line in your example $count = $ParsedXml->count(); Is it possible to put this count statement inside the foreach loop? each Product could have a different number of child nodes
  15. it is a statement so that count surely would not work as i don't know how many child nodes exist. the number is dynamic
×
×
  • Create New...