在php中获取发布值时遇到问题
这是以text/xml向我发送数据的post通知。获取发布的xml没有问题,但是如何获取在php中获取发布值时遇到问题,php,forms,post,Php,Forms,Post,这是以text/xml向我发送数据的post通知。获取发布的xml没有问题,但是如何获取X-Security-Data和X-Security-Hash的值呢 我习惯于使用$\u POST和$\u GET,但在本例中,我使用的是$xml\u POST=trim(file\u GET\u contents('php://input'));获取xml。。。其他两个值呢 X-Security-Data:1409261330848SEN140826-7569-89111S X-Security-Hash:
X-Security-Data
和X-Security-Hash
的值呢
我习惯于使用$\u POST和$\u GET,但在本例中,我使用的是$xml\u POST=trim(file\u GET\u contents('php://input'));代码>获取xml。。。其他两个值呢
X-Security-Data:1409261330848SEN140826-7569-89111S
X-Security-Hash:c063d68a6112dbc15e3eccf4943879b0
User-Agent:FS
Content-Length:584
Content-Type:text/xml; charset=UTF-8
Host:www.test.com
<subscription >
<enddate></enddate>
<nextperioddate>2015-08-26T00:00:00+0000</nextperioddate>
<periodcount>1</periodcount>
<test>true</test>
<quantity>10</quantity>
<reference>some reference</reference>
<customerurl>some url</customerurl>
<customer>
<fname>some name</fname>
<lname>some name</lname>
<company>some company</company>
<phone>11112223333</phone>
<email>test@test.com</email>
</customer>
</subscription>
X-Security-Data:1409261330848SEN140826-7569-89111S
X-Security-Hash:C063D68A6112DBC15E3ECCF49439B0
用户代理:FS
内容长度:584
内容类型:text/xml;字符集=UTF-8
主持人:www.test.com
2015-08-26T00:00:00+0000
1.
符合事实的
10
一些参考资料
一些url
某个名字
某个名字
某公司
11112223333
test@test.com
谢谢。。。这为我指明了正确的方向。再读几遍之后。。。有没有理由使用此方法而不是像$\u SERVER['X-Security-Hash']
这样的方法?一个在某些方面比另一个好?那也行。不知道php是否总是保证所有的请求头都显示在$\u服务器中,或者直到现在还只是假设。至少在使用getallheaders查询时,您可以直接从Apache获得它,而php只需很少的中介。使用$\u服务器不起作用,所以我尝试使用getallheaders并使用它的数组,效果非常好。再次谢谢你,马克