XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 3rd, 2004, 09:08 AM
fbnts fbnts is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 36 fbnts User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m 32 sec
Reputation Power: 5
Print XML response from PHP

I am working on a project which involves receiving an XML http post, processing it and storing it to an SQL database and returning a XML Response.

I have battled through and have the receiving script working fine but am having problems returning XML data. Below is was im currently using:


$xml_output = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";
$xml_output .= "<DELIVERY_2_SMS>\n";
$xml_output .= "\t<SMSMESSAGE>\n";
$xml_output .= "\t\t<DESTINATION_ADDR>01234567890</DESTINATION_ADDR>\n";
$xml_output .= "\t\t<TEXT>Thankyou for your Message</TEXT>\n";
$xml_output .= "\t\t<TRANSACTIONID>1</TRANSACTIONID>\n";
$xml_output .= "\t\t<TYPEID>2</TYPEID>\n";
$xml_output .= "\t\t<SERVICEID>1</SERVICEID>\n";
$xml_output .= "\t\t<COSTID>2</COSTID>\n";
$xml_output .= "\t</SMSMESSAGE>\n";
$xml_output .= "</DELIVERY_2_SMS>\n";

echo $xml_output;

Im assuming my 1st problem is line 1:
$xml_output = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";

when it gets to the end ?> it is closing PHP for the page. I have tried doing \"? >\n";
but when run, the page says invalid whitespace.
Is there a simply way round this or am i in the completly wrong direction?

Any assistance would be most appreciated


Thomas Kirk

Reply With Quote
  #2  
Old March 16th, 2004, 03:08 AM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
Try
Code:
 $xml_output = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?" . ">\n";  
__________________
-james

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Print XML response from PHP


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


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





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