A 服务器 的a.php post数据到 B服务器的 b.php然后 B服务器的 b.php处理完数据后 将结果以 http://x.x.x.x/xx/a.php?result=xx 的形式返回给 A服务器 的a.php页面(与前面提到的a.php是同一个页面)。 在a.php我用socket (POST方式)发送数据部分代码如下: $request.="POST ".$URL_Info["path"]." HTTP/1.1\n";
$request.="Host: ".$URL_Info["host"]."\n";
$request.="Referer: $referrer\n";
$request.="Content-type: application/x-www-form-urlencoded\n";
$request.="Content-length: ".strlen($data_string)."\n";
$request.="Connection: close\n";
$request.="\n";
$request.=$data_string."\n"; //$data_string是发送的数据 $fp = fsockopen($URL_Info["host"],$URL_Info["port"]);
fputs($fp, $request);
while(!feof($fp)) {
$result .= fgets($fp, 128);
}
fclose($fp); 关于这一句:$result .= fgets($fp, 128);我怎样才能取得 result=xx ??求高人指点。。。