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

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

WBOY
WBOY原创
2016-07-11 08:44:082081浏览
跳至 [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;
?>
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn