public function index(){
$url = 'http://www.baidu.top/tp32/index.php/Home/Index/index2.html';
$info = parse_url($url);
$fp = fsockopen($info["host"],80,$errno,$errstr,30);
$head = "POST " . $info['path'] . "?" . $info["query"] . " HTTP/1.0\r\n";
$head .= "Host: " . $info['host'] . "\r\n";
$head .= "Referer: http://" . $info['host'] . $info['path'] . "\r\n";
$head .= "Content-type: application/x-www-form-urlencoded\r\n";
$head .= "Content-Length: ". strlen(trim($query)) . "\r\n";
$head .= "\r\n";
$head .= trim($query);
$write = fputs($fp,$head);
/*while(!feof($fp)){
$line = fread($fp,4096);
echo $line;
}*/
fclose($fp);
var_dump(123);die;
}
public function index2(){
sleep(5);
$res = M('test3')->add(['title'=>mt_rand(11111,99999)]);
var_dump($res);die;
}