peterhuynh Posted June 18, 2015 Share Posted June 18, 2015 Here is an example of what the "code" should look like: tonce=1377743828095093 &accesskey=1d87effa-e84d-48c1-a172-0232b86305dd &requestmethod=post &id=1 &method=buyOrder ¶ms=500,1 This is what I get: tonce=1434662836898942 &accesskey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx &requestmethod=post &id=1 &method=buyOrder ¶ms= Notice that the '&' sign has changed into a '¶', and 'params' is changed into 'ms', and it deson't recognize the parameters I put into the code. Any idea why this is? Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted June 18, 2015 Share Posted June 18, 2015 without knowing where and how this is being produced, where and how you are viewing the incorrect value, and what sort of processing might be occurring between those two points, it's impossible to tell. could be due to a programming problem changing the value or copy/pasting part for that value from somewhere that has some character encoding that looked correct where it was copied from, but isn't actually the charters they appeared to be or some type of character encoding issue with the method you are using to view the value. Quote Link to comment Share on other sites More sharing options...
QuickOldCar Posted June 19, 2015 Share Posted June 19, 2015 To expand on what mac_gyver said. Is hard for us to tell where this data is coming from in the first place. If it's a matter of displaying the output in html can use htmlentities() $parameters = "tonce=1377743828095093 &accesskey=1d87effa-e84d-48c1-a172-0232b86305dd &requestmethod=post &id=1 &method=buyOrder ¶ms=500,1"; echo htmlentities($parameters, ENT_QUOTES, "UTF-8"); & should actually be & or encoded %26 or %26amp%3B so there is no confusion to the browser output, it's just parsing by it's rules To prevent this you can encode and decode data that's expected to go through the address bar urlencode() urldecode() rawurlencode() rawurldecode(); Since it seems you are combining parameters for use in the address bar should try http_build_query() As an example from an array: $parameters = array("tonce"=>"1377743828095093","accesskey"=>"1d87effa-e84d-48c1-a172-0232b86305dd","requestmethod"=>"post","id"=>"1","method"=>"buyOrder","params"=>"500,1"); echo http_build_query($parameters, '', '&'); results: tonce=1377743828095093&accesskey=1d87effa-e84d-48c1-a172-0232b86305dd&requestmethod=post&id=1&method=buyOrder¶ms=500%2C1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.