【发布时间】:2012-04-23 09:21:18
【问题描述】:
我有一个 codeigniter 应用程序,它通过 authorize.net 有一个结帐系统。我使用的 authorize.net 库执行 curl 进行付款,但完成后我无法重定向,因为
headers already sent by (output started at /Users/phil/Sites/Medbridge/httpdocs/application/libraries/AuthorizeCimLib.php:1
这就是日志所说的。如果我注释掉付款的东西,它会重定向罚款。我不知道我是否不了解卷曲,这就是它正在做某事的原因,或者我是否需要更改一些卷曲设置。
谢谢
编辑
这是我正在使用的库的链接,它很大,不想重新发布整个代码
http://www.communitymx.com/content/article.cfm?page=4&cid=FDB14
这是卷曲部分,也许有人可以看到这是否正在输出到标题
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLINFO_HEADER_OUT, FALSE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->_xml);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$this->_response = curl_exec($ch);
谢谢
【问题讨论】:
-
正如错误所说,标题之前没有输出。
-
我看到了,那么 curl 被认为是输出吗?
-
确保在您的 AuthorizeCimLib.php 文档顶部开始
-
在发送 HTTP 标头之前有一些输出(但必须先输出标头)
-
我在
标签: php codeigniter curl payment-gateway