Problem when using CURL

Hi Guys…

When I use the following script, it works fine (executes what it should do). However, upon executing curl_exec() I get a popup and asks me if I want to save the file, see this screenshot:

This should not happen, it should just return the XML response packet. Any idea why it’s doing this?

My guess is it’s a header problem, but i’ve tried everything. Can anyone shed some light on the problem?

$data = '
					<?xml version="1.0" encoding="UTF-8" ?>
					  <packet version="'.$this->sitevar['parking_version'].'">
					$url = "https://".$this->sitevar['parking_ip'].":".$this->sitevar['parking_port']."/".$this->sitevar['parking_path'];
					$headers = array(
						"POST /enterprise/control/agent.php HTTP/1.1",
						"HTTP_AUTH_LOGIN: ".$this->sitevar['parking_username'],
						"HTTP_AUTH_PASSWD: ".$this->sitevar['parking_password'],
						"Content-Length: ".strlen($data),
						"Content-Type: text/xml");
					// Initalize the curl engine
					$CurlHandle = curl_init();
					// Set the curl options
					curl_setopt($CurlHandle, CURLOPT_SSL_VERIFYHOST, 1);
					// this line makes it work under https
					curl_setopt($CurlHandle, CURLOPT_SSL_VERIFYPEER, FALSE);
					// pass in the header elements
					curl_setopt($CurlHandle, CURLOPT_HTTPHEADER, $headers);
					// Set the URL to be processed
					curl_setopt($CurlHandle, CURLOPT_URL, $url);
					// Set the data to be send
					curl_setopt($CurlHandle, CURLOPT_POSTFIELDS, $data);
					// Return details
					curl_setopt($CurlHandle, CURLOPT_RETURNTRANSFER, 1);
					$Return = curl_exec($CurlHandle);
					print_r($Return); exit;

It seems that a file, admincp.php is returned on curl, not an array or data object.

why are you print_r’ing your return? Surely you just want to output the data returned (What data is it returning?)