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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 6:42 PM -0500 1/2/08, Daniel Brown wrote:
On Jan 2, 2008 6:32 PM, tedd <tedd.sperling@xxxxxxxxx> 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.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux