Php Can';t使用lot of variable重定向-检测到新行时,标头可能不包含多个标头。在里面

Php Can';t使用lot of variable重定向-检测到新行时,标头可能不包含多个标头。在里面,php,http-headers,Php,Http Headers,这是我的代码: $post_url="Location: http://webservices.plattformpartners.com/ilm/default.ashx?firstname=".$firstname."&lastname=".$lastname."&address=".$address1."&address2=".$address2."&zip=".$zip."&city=".$city."&state=".$state."&a

这是我的代码:

$post_url="Location: http://webservices.plattformpartners.com/ilm/default.ashx?firstname=".$firstname."&lastname=".$lastname."&address=".$address1."&address2=".$address2."&zip=".$zip."&city=".$city."&state=".$state."&country=".$country;

header($post_url);
在这一页上,我正在使用这个

我在表单提交后重定向时遇到此错误。。 警告:标题不能包含多个标题,检测到新行。在第60行的/home/gedforad/public_html/index.php中

有没有办法用很多变量来重定向它? 当我在一两个变量中使用它时,它的重定向是正确的,但在很多变量中,它的生成错误

提前感谢。

阅读错误:“检测到新行”

我认为问题不在于变量太多。您的一个变量中可能有新行。首先尝试对URL进行编码,它应该可以正常工作:

我使用:$post\u url=rawurlencode($post\u url);标题($post_url);但现在我得到(500个内部服务器错误)…这可能是任何数量的事情。您需要查看日志中出现的错误。问题解决后,新行出现问题。我现在注意到了。。我不能投票支持你,因为我不允许。谢谢你的帮助……当然,没问题。我知道你不能用低级别投票,但如果你愿意,你当然可以通过点击复选标记“接受”答案。不管怎样,很高兴修好了。