http+socket发送短信-创新互联

public  function Post($data, $target) {
   $url_info = parse_url($target);
   $httpheader = "POST " . $url_info['path'] . " HTTP/1.0\r\n";
   $httpheader .= "Host:" . $url_info['host'] . "\r\n";
   $httpheader .= "Content-Type:application/x-www-form-urlencoded\r\n";
   $httpheader .= "Content-Length:" . strlen($data) . "\r\n";
   $httpheader .= "Connection:close\r\n\r\n";
   //$httpheader .= "Connection:Keep-Alive\r\n\r\n";
   $httpheader .= $data;

   $fd = fsockopen($url_info['host'], 80);
   fwrite($fd, $httpheader);
   $gets = "";
   while(!feof($fd)) {
       $gets .= fread($fd, 128);
   }
   fclose($fd);
   if($gets != ''){
       $start = strpos($gets, '       if($start > 0) {
           $gets = substr($gets, $start);
       }
   }
   return $gets;
}

创新互联www.cdcxhl.cn,专业提供香港、美国云服务器,动态BGP最优骨干路由自动选择,持续稳定高效的网络助力业务部署。公司持有工信部办法的idc、isp许可证, 机房独有T级流量清洗系统配攻击溯源,准确进行流量调度,确保服务器高可用性。佳节活动现已开启,新人活动云服务器买多久送多久。

创新互联于2013年成立,是专业互联网技术服务公司,拥有项目网站设计、成都做网站网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元紫金做网站,已为上家服务,为紫金各地企业和个人服务,联系电话:13518219792
文章标题:http+socket发送短信-创新互联
文章网址:http://scyanting.com/article/hcgoj.html