Rumah >php教程 >PHP源码 >禅道7.2.5集成svn官方脚本不能用的解决方法

禅道7.2.5集成svn官方脚本不能用的解决方法

WBOY
WBOYasal
2016-07-11 08:44:082082semak imbas
跳至 [1] [全屏预览]
<?php


$data='account=test&password=123456';   // zhang hao mi ma
$curlobj = curl_init();
curl_setopt($curlobj, CURLOPT_URL, "http://localhost/zt3/www/index.php?m=user&f=login");   //chan dao index.php
curl_setopt($curlobj, CURLOPT_RETURNTRANSFER, true);

date_default_timezone_set('PRC');
curl_setopt($curlobj, CURLOPT_COOKIESESSION, TRUE); 
curl_setopt($curlobj, CURLOPT_COOKIEJAR, 'cookie.txt ');
curl_setopt($curlobj, CURLOPT_COOKIEFILE, 'cookie.txt ');
curl_setopt($curlobj, CURLOPT_HEADER, 0);
curl_setopt($curlobj, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curlobj, CURLOPT_COOKIE,session_name().'='.session_id()); 

curl_setopt($curlobj, CURLOPT_POST, 1);  
curl_setopt($curlobj, CURLOPT_POSTFIELDS, $data);  
curl_setopt($curlobj, CURLOPT_HTTPHEADER, array("application/x-www-form-urlencoded; charset=utf-8", 
	"Content-length: ".strlen($data)
	)); 
curl_exec($curlobj);
curl_setopt($curlobj, CURLOPT_URL, "http://localhost/zt3/www/index.php?m=svn&f=run");  //index.php + ?m=svn&f=run
curl_setopt($curlobj, CURLOPT_POST, 0);  
curl_setopt($curlobj, CURLOPT_HTTPHEADER, array("Content-type: text/xml"
	)); 
$output=curl_exec($curlobj);
curl_close($curlobj);
echo $output;
?>
Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn