corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » XML/PHP


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author XML/PHP
Laney
Member

Registered: 6th May 03
Location: Leeds
User status: Offline
25th Apr 07 at 21:37   View User's Profile U2U Member Reply With Quote

Am I right in thinking that you can't parse XML to the browser using PHP?

Basically I want to output data from a database into an XML format instead of regular HTML. I've googled it but the only suggestion is to create a new XML document each time. Is this the way I should be thinking?

James
Member

Registered: 1st Jun 02
Location: Surrey
User status: Offline
25th Apr 07 at 21:38   View User's Profile U2U Member Reply With Quote

SQL can output in XML directly without using PHP.

http://www.topxml.com/sql/for_xml_explicit.asp
Laney
Member

Registered: 6th May 03
Location: Leeds
User status: Offline
25th Apr 07 at 21:49   View User's Profile U2U Member Reply With Quote

That looks a bit complicated

For future reference, this was just what I was looking for: http://www.builderau.com.au/program/php/soa/Dynamic-XML-document-construction-with-the-PHP-DOM/0,339028448,339273222,00.htm Stupid google
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
26th Apr 07 at 00:32   View Garage View User's Profile U2U Member Reply With Quote

Can you not just use the header() function?

You're just spoofing the MIME type, right? Apologies if there is more to it that I'm missing but that would be my starting point.
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
26th Apr 07 at 00:35   View Garage View User's Profile U2U Member Reply With Quote

Check the source of this

http://www.corsasport.co.uk/board/rssads.php

Thats just a regular database query but instead of printing HTML code around the data its got RSS XML.

I can give you the PHP source to that if you want but there really was no science bit, just header() and the echos in the right places.

[Edited on 26-04-2007 by Ian]
Laney
Member

Registered: 6th May 03
Location: Leeds
User status: Offline
26th Apr 07 at 14:10   View User's Profile U2U Member Reply With Quote

Awesome Thanks Ian.
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
26th Apr 07 at 15:03   View Garage View User's Profile U2U Member Reply With Quote

Worth noting that it was a bit of a hack and doesn't probably conform to any specs, I just looked at some other feeds and made mine the same.

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
Why can't i see Vibro's replys paul_spurrell General Chat 173 5872
14th Nov 05 at 13:24
by Cybermonkey
 
sooty's rr figures and bhp loss in simple form J da Silva General Chat 18 1039
23rd Nov 03 at 13:08
by mistdotcom
 
postage costs RobHayes Help Zone, Modification and ICE Advice 5 679
6th Jan 04 at 23:37
by Trucido
 
Website geeks (help) Bart Geek Day 7 712
20th Apr 06 at 10:57
by Houckham
 
another way of catching u speeding ClaireF General Chat 3 722
12th May 06 at 09:54
by Adam-D
 

Corsa Sport » Message Board » Off Day » Geek Day » XML/PHP 28 database queries in 0.0112710 seconds