XML Requests
Posted: Thu Sep 04, 2008 4:15 am
Im currently developing a front-end client system for a reseller account using XML RPC.
The function below creates an XML request to send to the server (this is an example function):
The code brings up an "unexpected $end" error on the line "<?xml version='1.0' encoding='utf-8' ?>". This is due to the "?>" of the XML declaration.
Any way to get around this using the same <<<XML return method? If not then i guess constructing and returning a string will have to do!
Thanks in advance
The function below creates an XML request to send to the server (this is an example function):
Code: Select all
function construct_xml ($domain) { //returns XML request using user-inputted data eg: domain supplied for avaliability checking
return <<<XML
<?xml version='1.0' encoding='utf-8' ?>
<rpc module='Domain' method='Availability' version='1.0'>
<auth>
<username>foo</username>
<password>bar</password>
</auth>
<domain datatype='domain_name'>$domain</domain>
</rpc>
XML;
}Any way to get around this using the same <<<XML return method? If not then i guess constructing and returning a string will have to do!
Thanks in advance