如何POST xml 把xml循环到数组里然后post数组不可能直接post xml或者你post一个xml地址,接受到后,去读xml 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 谢谢楼上的朋友 本人真的不会PHP 希望获得原码!! 假设要POST的地址是 http://www.xxx.com/xxx.aaa$post = <<<DOC<?xml version="1.0" encoding="UTF-8"?><test>This is a XML.</test>DOC;$http_header = "";$http_header .= "POST /xxx.aaa HTTP/1.1\r\n";$http_header .= "Content-Type: application/x-www-form-urlencoded\r\n";$http_header .= "Host: www.xxx.com\r\n";$http_header .= "Content-Length: ".strlen($post)."\r\n";$http_header .= "Connection: Keep-Alive\r\n";$http_header .= "Cache-Control: no-cache\r\n";$http_header .= "\r\n";$fp = @fsockopen("www.xxx.com", 80, $errno, $errstr, 30);if (!$fp){ //---- 连不上 ---- exit;}fwrite($fp, $http_header);fwrite($fp, $post);echo fgets($fp, 1280);fclose($fp); 假设要POST的地址是 http://www.xxx.com/xxx.aaa$post = <<<DOC<?xml version="1.0" encoding="UTF-8"?><test>This is a XML.</test>DOC;$http_header = "";$http_header .= "POST /xxx.aaa HTTP/1.1\r\n";$http_header .= "Content-Type: application/x-www-form-urlencoded\r\n";$http_header .= "Host: www.xxx.com\r\n";$http_header .= "Content-Length: ".strlen($post)."\r\n";$http_header .= "Connection: Keep-Alive\r\n";$http_header .= "Cache-Control: no-cache\r\n";$http_header .= "\r\n";$fp = @fsockopen("www.xxx.com", 80, $errno, $errstr, 30);if (!$fp){ //---- 连不上 ---- exit;}fwrite($fp, $http_header);fwrite($fp, $post);echo fgets($fp, 1280);fclose($fp); 哪位大咖知道这段代码是做什么的? MySQL的语法错误,帮忙找找 关于模拟登陆的问题,使用的fsockopen。 救命啊,php奇怪问题 php和lighttpd如何同步输出 求教:函数名前加$是什么意思啊? 关于domxml_open_mem方法的使用,大家来帮帮忙 php中有没有象asp那样的application的对象 php的下载怎么做? PHP两个问题~ 缓存成什么格式的文件效率高 MySQL 6.0 有严重的 BUG
<?xml version="1.0" encoding="UTF-8"?>
<test>
This is a XML.
</test>DOC;$http_header = "";
$http_header .= "POST /xxx.aaa HTTP/1.1\r\n";
$http_header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$http_header .= "Host: www.xxx.com\r\n";
$http_header .= "Content-Length: ".strlen($post)."\r\n";
$http_header .= "Connection: Keep-Alive\r\n";
$http_header .= "Cache-Control: no-cache\r\n";
$http_header .= "\r\n";$fp = @fsockopen("www.xxx.com", 80, $errno, $errstr, 30);
if (!$fp)
{
//---- 连不上 ----
exit;
}
fwrite($fp, $http_header);
fwrite($fp, $post);
echo fgets($fp, 1280);
fclose($fp);
<?xml version="1.0" encoding="UTF-8"?>
<test>
This is a XML.
</test>DOC;$http_header = "";
$http_header .= "POST /xxx.aaa HTTP/1.1\r\n";
$http_header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$http_header .= "Host: www.xxx.com\r\n";
$http_header .= "Content-Length: ".strlen($post)."\r\n";
$http_header .= "Connection: Keep-Alive\r\n";
$http_header .= "Cache-Control: no-cache\r\n";
$http_header .= "\r\n";$fp = @fsockopen("www.xxx.com", 80, $errno, $errstr, 30);
if (!$fp)
{
//---- 连不上 ----
exit;
}
fwrite($fp, $http_header);
fwrite($fp, $post);
echo fgets($fp, 1280);
fclose($fp);