<?php header("Content-Type: text/xml; charset=utf-8"); $TEXT_OUTPUT=true; $referrer_host=parseURL($_SERVER['HTTP_REFERER'],PHP_URL_HOST); if ($referrer_host!=$Config->SERVER_DOMAIN) return; $DBConn->connect(true); $country=TGET('country'); $zipcode=TGET('zipcode'); try { $sxe=new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><zcinfolist/>',null,false); if ($country && $zipcode) { $zcinfo=db_load_address_from_zipcode($DBConn,$country,$zipcode); foreach ($zcinfo as $record) { $zi=$sxe->addChild('zcinfo'); foreach ($record as $key=>$value) $zi->addChild($key,$value); } } echo $sxe->asXML(); } catch (Exception $e) { echo $e->getMessage(); } ?>