I want to read XML data from a URL in Magento.
I have three textboxes. One is for baseurl and others are for username and password respectively. when i enter these values i get url like "http://xyz.com/somefile.html?username=username&password=password"
I am using the curl method to get content of the url but nothing happens. Here is my code
$url='myurl';
$ch = curl_init();
$timeout = 5;
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$data = curl_exec($ch);
curl_close($ch);
I think there may be some problem with url because when i run this url on browser instead of showing xml contents it asks me to open or save the xml file.
Can anyone help me with this? I can not change the url so please suggest me some code that works with this type of url.
text/plain, the the browser will display it just fine.