-1
我解析需要驗證的XML文件。 一切正常,文件正確下載,但XML認證文件的內容打印在html頁面上。我怎樣才能避免這種行爲?
下面是XML文件
<maxi-xml>
<login>Login successful</login>
</maxi-xml>
這裏是捲曲連接
$ch = curl_init();
$cookiefile = tempnam("tmp", "cookies");
curl_setopt($ch, CURLOPT_URL,"http://www.maxithlon.com/maxi-xml/login.php?user=$_SESSION[user]&scode=$_SESSION[password]");
curl_exec($ch);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile);
curl_exec($ch);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile);
curl_setopt($ch, CURLOPT_URL, "http://www.maxithlon.com/maxi-xml/athletes.php?");
$fp = fopen('xml/'.$_SESSION[teamid].'_athletes.xml', 'w');
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_exec($ch);
謝謝!快速且有幫助:) 編輯,我需要5分鐘才能接受答案 – djpredator17
不客氣。 –