PHP - return from URL that takes XML string
<p>I have a URI that takes an XML arg and returns an XML result.  Works superbly when I run it in a browser by itself.</p>

<p>I need to use this script as part of an AJAX query, so I was hoping to get a result from the URL and then just echo it out to the AJAX call.  I've tried using fopen, but I don't get a result.</p>

<p>Is there a simple way to accomplish this?  I've seen references to using a proxy, but can't find an example of how to do that with php.</p>

<pre><code>$street = $_GET['street'];
$city = $_GET['city'];
$state = $_GET['state'];
$zip = $_GET['zip'];

$url = 'http://eligibility.cert.sc.egov.usda.gov/eligibility/eligibilityservice?eligibilityType=Property&amp;requestString=';
$url_query = '%3C?xml%20version=%221.0%22?%3E%3CEligibility%20xmlns:xsi=%22http://www.w3.org/2001/XMLSchema-instance%22%20xsi:noNamespaceSchemaLocation=%22/var/lib/tomcat5/webapps/eligibility/Eligibilitywsdl.xsd%22%3E%3CPropertyRequest%20StreetAddress1=%22'.$street.'%20street%22%20StreetAddress2=%22%22%20StreetAddress3=%22%22%20City=%22'.$city.'%22%20State=%22'.$state.'%22%20County=%22%22%20Zip=%22'.$zip.'%22%20Program=%22RBS%22%3E%3C/PropertyRequest%3E%3C/Eligibility%3E';
$url_final = $url.''.$url_query;

$return = fopen($url_final);
echo $return;
</code></pre>
