Re: rawurldecode problems

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

 



On Fri, May 27, 2005 1:26 pm, Jeremy Reynolds said:
> I'm using the rawurldecode() function to try and polish up some data
> I get from a parameter
>
> I use the function below and this is what it does.  It's as-if it
> only unencodes the last part.  Anybody have ideas on what I'm doing
> wrong?
>
> $order = rawurldecode($HTTP_GET_VARS["x"]);
>
> 3445%252520Causeway%252520Boulevard%252520Limited%252520Partnership%25250ACape%2520May%2520Apartments,%2520LLC%250AElco%20Housing%20Partners,%20LLC%0A
>
> 3445%20Causeway%20Boulevard%20Limited%20Partnership%0ACape May Apartments,
> LLC
> Elco Housing Partners, LLC
>
> it SHOULD look like this:
>
> 3445 Causeway Boulevard Limited Partnership
> Cape May Apartments, LLC
> Elco Housing Partners, LLC
>
>
> If this helps... the original long string was written with \n between
> each value before it was encoded.  Does that have anything to do with
> it?

The newline should be okay -- Those are the %0A you see in your data.

What seems more likely is that you somehow have urlencoded the first line
*TWICE* so when you urldecode the whole thing, you end up with correct
data on all lines except the first one.

Check your code the encoded the data, if possible.

If you're stuck with what you've got for data, then you'll just have to
document the flaw in the data, and use http://php.net/explode ("\n",
$data) after your current rawurldecode() then rawurldecode() the first
element to get it back to what it should be.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
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