Home > php教程 > PHP源码 > body text

Solution to the problem that ZenTao 7.2.5 integrated svn official script cannot be used

WBOY
Release: 2016-07-11 08:44:08
Original
2069 people have browsed it
Jump to [1] [Full screen preview]
<?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;
?>
Copy after login
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template