(很多开放服务接口可用到)
与提交表单信息相比 不同之处只在于 提交信息不需转码直接放入\r\n\r\n下方即可...
提交页面代码如下
function getPost($host,$file,$port,$postVal){
$len = strlen($postVal);
$out = "POST $file HTTP/1.1\r\n";
$out .= "Host: $host\r\n";
$out .= "Content-type: application/x-www-form-urlencoded\r\n";
$out .= "Connection: Close\r\n";
$out .= "Content-Length: $len\r\n";
$out .="\r\n";
$out .= $postVal."\r\n";
$fp = @fsockopen($host,$port,$errno,$errstr,30);
if(!$fp){
echo "$errstr($errno)\n";
}else{
fwrite($fp,$out);
while(!feof($fp)){
$receive.= fgets($fp);
}
}
echo $receive;
fclose($fp);
}
$Login_Pwd = md5("*****");
$Start_Time = "2007-11-11 11:11:11";
$End_Time = date("Y-m-d H:i:s");
echo $Login_Pwd;
$postVal = "<Root Login_Name=\"*****\" Login_Pwd=\"7C41850DFA2FCB236CF8837F91FD73FD\" Service_Type=\"4\" InterFaceID=\"0\"> \r\n ";
$postVal.= "<Item>";
$postVal.= "<Search_ID>16815705</Search_ID> \r\n";
$postVal.= "</Item>\r\n";
$postVal.= "</Root> \r\n";
//echo $arrVal["rb"];
getPost("userinterface.vcomcn.com","/GetResult.aspx",80,$postVal);
*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。