<?php
// $curl=curl_init();
// $url="http://localhost/cc/get.php?lo=ccc";
// curl_setopt($curl,CURLOPT_URL, $url);
// curl_exec($curl);
// curl_close($curl); $curl=curl_init();
$url="http://localhost/cc/post.php";
curl_setopt($curl,CURLOPT_URL, $url);
curl_setopt($curl,CURLOPT_POST,true);//改为POST传输
$post_data=array('username'=>'admin','pwd'=>'admin888','captcha'=>'qqq',
'logo'=>'@C:/Users/Administrator/Desktop/www.png');//文件名前要加上@,告诉服务器,这是文件
curl_setopt($curl,CURLOPT_POSTFIELDS,$post_data);//放入传输数据 //如果要实现session或cookies就要设定保存cookies
//curl_setopt($curl,CURLOPT_COOKIEJAR,"./xx.txt"); //第二次用session或cookies就用下边这个
//curl_setopt($curl,CURLOPT_COOKIEFILE,"./xx.txt");
curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);//如果不加这个会直接输出
$rs=curl_exec($curl);
curl_close($curl); ?>
<?php
session_start();
echo $_SESSION["a"]="asdf";
// echo $_POST["username"];
// var_dump($_FILES);
// move_uploaded_file($_FILES['logo']['tmp_name'],'./p.jpg');
// echo "上传成功"; ?>