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