你看宝塔API的就是要读写cookie才可以的。[ol]private function HttpPostCookie($url, $data,$timeout = 60){$cookie_file='./Cookie/'.md5($this->BT_PANEL).'.cookie';if(!file_exists($cookie_file)){$fp = fopen($cookie_file,'w+');fclose($fp);} $ch = curl_init();curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, $data);curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_HEADER, 0);curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);$output = curl_exec($ch);curl_close($ch);return $output;}[/ol]复制代码