//经过检查发现是支付宝接口alipay_notify.php //中get_verify()有问题 $fp=@fsockopen($transports.$urlarr['host'],$urlarr['port'],$errno,$errstr,$time_out); if(!$fp) { die("ERROR: $errno - $errstr<br />\n"); } else { fputs($fp, "POST ".$urlarr["path"]." HTTP/1.1\r\n"); fputs($fp, "Host: ".$urlarr["host"]."\r\n"); fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n"); fputs($fp, "Content-length: ".strlen($urlarr["query"])."\r\n"); fputs($fp, "Connection: close\r\n\r\n"); fputs($fp, $urlarr["query"] . "\r\n\r\n"); while(!feof($fp)) { $info[]=@fgets($fp, 1024); } fclose($fp); $info = implode(",",$info); return $info; //修改后的代码: $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $urlarr["query"]); curl_setopt($curl, CURLOPT_TIMEOUT, $time_out); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $info = curl_exec($curl); if (curl_errno($curl)) { $error=curl_error($curl); $this->_log_result($error); echo '<pre><b>错误:</b><br />'.curl_error($curl); } curl_close($curl); return $info; ////经过测试。返回数据正确,付款成功,并更新订单,显示已付款