简体   繁体   English

PHP发布数据问题

[英]Problem with PHP Post Data

If anyone could help me with the problem I'm having I would be one happy programmer. 如果有人可以帮助我解决这个问题,我将成为一名快乐的程序员。 I'm working on an e-commerce site that is having trouble authenticating with the gateway. 我正在一个电子商务网站上,该网站无法通过网关进行身份验证。 This problem just start randomly on a site that had been working for years. 这个问题只是在已经工作了多年的站点上随机出现的。 This suggest to me that either the host made a change / update to it's PHP configuration or some other configuration setting was changed by the client. 这对我来说建议是主机对其PHP配置进行了更改/更新,或者客户端更改了某些其他配置设置。

Here is an image of the problem in Fiddler: alt text http://www.pivotalhorizon.com/mike/random_files/sc_2.jpg 这是Fiddler中问题的图像: 替代文本http://www.pivotalhorizo​​n.com/mike/random_files/sc_2.jpg

You can see in the areas I have in a red box the values have extra characters (ie instead of just "59.00" it is "59.00\\n73\\n". I have no clue where these extra characters are coming from. The previous page (order preview) uses the same values and they display fine; however, this final page (confirm order) has the extra crap. 您可以在红色框中看到的区域中,值具有额外的字符(即,不是“ 59.00”,而是“ 59.00 \\ n73 \\ n”。我不知道这些额外字符来自何处。) (订单预览)使用相同的值,并且显示效果很好;但是,最后一页(确认订单)有很多废话。

Any ideas? 有任何想法吗?

For those that wanted it, here is the code in a nutshell: 对于那些需要它的人,下面是简而言之的代码:

Here is the code 这是代码

on the order preview page you have the following in a form using POST: 在订单预览页面上,使用POST的形式具有以下内容:

<input type="hidden" name="CCType" value="VISA">

and the on the order confirm page (the page you see in fiddler above): 以及订单确认页面(您在上方的提琴手中看到的页面)上:

$CCType = $HTTP_POST_VARS['CCType'];
<INPUT TYPE="HIDDEN" NAME="x_Card_Type" VALUE="<?=trim($CCType)?>">

basically, page 1 says variable = value. 基本上,第1页说变量=值。 The variable then moves to page 2 via the post and page 2 outputs the value stored in the variable. 然后,变量通过帖子移至页面2,页面2输出存储在变量中的值。

I see the answer posted below and I'll investigate that. 我将看到下面发布的答案,我将对此进行调查。

This is Chunked Transfer Encoding . 这是分块传输编码 It's part of HTTP 1.1 protocol (you can find such bytes on other sites). 它是HTTP 1.1协议的一部分(您可以在其他站点上找到此类字节)。 This numbers tell browser how many bytes will be sent in next chunk of data. 该数字告诉浏览器在下一个数据块中将发送多少字节。 You'll never see them on page. 您将永远不会在页面上看到它们。

You don't need to warry about it. 您无需为此担心。 Just click on yellow line in Fidder saying "Responce is encoded... Click here is transform." 只需单击Fidder中的黄线,上面写着“响应已编码...单击此处为变换”。 If you have "Show Toolbar" enabled in Fidder menu, then click on "AutoDecode" button, which will make Fiddler to decode it automatically. 如果您在Fidder菜单中启用了“显示工具栏”,则单击“自动解码”按钮,这将使Fiddler自动对其进行解码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM