Forum Moderators: coopster

Message Too Old, No Replies

Special chars after POST

         

cdmn

10:26 pm on Mar 8, 2009 (gmt 0)

10+ Year Member



Hi there everyone,

i have a strange situation, ffter form POST my "\t" becomes "space".

For example, i have input with data: "1\tA" and after posting a form and printing out POST array i can see that this field data becomes "1 A" not "1\tA"...

I checked with rawurlencode to be sure.
"1\tA" is "1%09A" after POST "1%20A"

I cant really get this, why "\t" becomes "space" after form post...

g1smd

11:35 pm on Mar 8, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The \t is an escaped character representing the ASCII character x09, which is a TAB.

Your system likely converts "non-printable" characters to spaces.

Escape the slash itself to get it through the system as a literal slash.

1\\tA

You also need to be wary of \0 \a \b \e \f \n \r \v and others.

cdmn

2:06 am on Mar 9, 2009 (gmt 0)

10+ Year Member



Em... im not using \t, i just didnt know how to post here but its just a string with tab, like this "1 A".

Im making request (post) with mootools Request method.
There is a field <input ... value="1 A" /> i changed form method to GET and i can see "field_name=1%09A", but when i try to print out echo $_GET['field_name'], i get "1 A" or urlencode($_GET['field_name']) "1%20A"...

OMG its such a headache, i dont know where to turn...

cdmn

9:52 am on Mar 9, 2009 (gmt 0)

10+ Year Member



someone?

coopster

2:50 pm on Mar 9, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I'm guessing something in your client-side code (JavaScript) is converting the tab to a space, not PHP. Use a tool like the Firebug extension for Firefox to monitor the value as you step through your form submission to monitor the value.