我想贝宝在我的网站整合但之后,我按PayPal按钮会出现这样的错误:用PHP头冲突需要
Warning: Cannot modify header information - headers already sent by (output started at X:\home\test\www\view\main.php:29) in X:\home\test\www\view\frontend\paypalfunctions.php on line 377
负责错误的main.php的部分是这样的:
<div class="container">
<?php require 'view/frontend/'.$tpl.'.php';?>
</div>
这行代码对我整个网站的工作至关重要。它相冲突与PayPal的paypalfunctions.php这个特殊的功能:
function RedirectToPayPal ($token)
{
global $PAYPAL_URL;
// Redirect to paypal.com here
$payPalURL = $PAYPAL_URL . $token;
header("Location: ".$payPalURL);
exit;
}
我仔细看了this question关于这个问题,并尝试了一些东西,但没有找到一个解决方案。有什么我需要改变它的代码工作?