Re: First stupid post of the year. [SOLVED]

From: Date: Thu, 03 Jan 2008 01:37:35 +0000
Subject: Re: First stupid post of the year. [SOLVED]
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-266549@lists.php.net to get a copy of this message
On Jan 2, 2008 7:36 PM, tedd <tedd.sperling@gmail.com> wrote: > At 6:42 PM -0500 1/2/08, Daniel Brown wrote: > >On Jan 2, 2008 6:32 PM, tedd <tedd.sperling@gmail.com> wrote: > > > > > Nope, it produces: > >> > >> %C2%C2%C2%C2%C2A%C2%C2%C2 > >> > >> Thanks for trying :-) > > > > Why is it that things work perfectly for me until you test them? > > It's because I have a tester. > > You see, it's easy to say "Nope, that don't work." But, it's much > harder to find a solution. > > Finding a solution is usually best served when one doesn't under > estimate the problem, as many here have already demonstrated. > > As it turns out, this problem is more complex than any of us has been > able to fathom thus far. > > When a string containing non-breaking spaces is sent via a POST, what > do those non-breaking spaces become? It's clear that they are not > spaces, nor are they &nbsp; > > To find out, I did put the operation through FireFox and reversed the > POST/GET operations to get a look at the string -- it is: > > %C2%A0%C2%A0%C2%A0Z%C2%A0%C2%A0%C2%A0 < where Z is the value passed. > > Now, C2 (HEX) is a linefeed (194 DEC) > > And, A0 (HEX) is a non-breaking space (160 DEC;) which is a &nbsp; > > Therefore, if I simply use: > > $submit = str_replace( chr(194), '', $submit ); > $submit = str_replace( chr(160), '', $submit ); > > This is the solution. > > Now, why does a POST operation add in C2's? I'll leave that for > another post. :-) > > Thanks everyone for your time. I hope we all learned something, I did. Well, believe it or not, that was the highlight of my day, which began with everything going wrong - not just normal, small things like stubbing your toe, but rather larger - and culminated in my truck burning up while I was driving to a datacenter for a client. Now the research begins.... why DOES that C2 get thrown in? P.S. - If someone has the answer, don't tell me, because I'd like something to keep Wednesday off my mind for the rest of the week. -- Daniel P. Brown [Phone Numbers Go Here!] [They're Hidden From View!] If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you.

« previous php.general (#266549) next »