Reply to Re: Is ',' bad in the url?

Your name:

Reply:


Posted by Toby A Inkster on 12/08/07 13:08

FFMG wrote:

> It all works fine but the ',' is converted to the html '%2C', (I use php
> URLencode, http://php.net/urlencode).

The PHP urlencode() function is a little overcautious. It encodes
virtually any non-alphanumeric character in the URL, even though many
would be perfectly safe to leave unencoded.

If you prefer your commas to be unencoded, then I suggest writing your
own replacement for urlencode. It's not difficult.

If you're using PHP 5.3+ with namespaces, then you can even name your
function "urlencode()" too, so that you don't need to go through all your
files replacing calls to urlencode() with my_urlencode().

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 23:40.]

Sharing Music with Apple iTunes
http://tobyinkster.co.uk/blog/2007/11/28/itunes-sharing/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация