I am working on PHP and XML. I am sending some values like origin,Destination,Journeydate,Returndate
to a particular URL. As a result according to my Values some XML data is generating in that URL. Now i want to fetch that generated result(XML Data) and print on my page.
I have tried the below code for printing the data of a URL
$url="your url";
$xmlinfo = simplexml_load_file($url);
print_r($xmlinfo);
It is not working.
I think it will work for the URL's which will contain Static XML data.
But here i want to send some values to a url. There the result will generate and then i want to get that generated result.
Here is the code how i am sending the values to URL
<HTML>
<HEAD>
<script language="Javascript">
function submit_search()
{
window.document.forms[0].action="URL";
window.document.forms[0].submit();
}
</script>
</HEAD>
<BODY>
<form method="post">
XML Request:
<input type="text" name="xmlRequest" id="fromcity"
value="<AvailRequest>
<Trip>ONE</Trip>
<Origin>BOM</Origin>
<Destination>JFK</Destination>
<DepartDate>2013-05-01</DepartDate>
<ReturnDate>2013-05-05</ReturnDate>
<AdultPax>1</AdultPax>
<ChildPax>0</ChildPax>
<InfantPax>0</InfantPax>
<Currency>INR</Currency>
<PreferredClass>E</PreferredClass>
<Eticket>true</Eticket>
</AvailRequest>" />
<input type="button" name="SUBMIT" value="submit" onClick="submit_search();"/>
</form>
</BODY>
</HTML>
Thanks in Advance, Shoba