You are here: Re: [PHP] mozilla & urlencode « PHP « IT news, forums, messages
Re: [PHP] mozilla & urlencode

Posted by Marek Kilimajer on 06/04/05 14:12

John Taylor-Johnston wrote:
> I seem to have a problem with Mozilla or with IE?
>
> echo "<a name=\"".urlencode($mydata->district)."\"></a>";
> <a name="Montr%E9al+District+%234"></a>
>
> http://foo.org/_private/directory.php#Montr%E9al+District+%234 works in
> IE6, but Mozilla will not accept it.
>
> Mozilla does not work. Am I approaching this wrong? Should I create my
> HTML this way?
>
> echo "<a name=\"".$mydata->district."\"></a>";
> <a name="Montréal District #4"></a>
>
> If I do, Mozilla prferes this:
>
> http://foo.org/_private/directory.php#Montr%E9al%20District%20#4
> or
> http://foo.org/_private/directory.php#Montr%E9al%20District%20%234
>
> IE refuses it and prefers:
>
> http://foo.org/_private/directory.php#Montr%E9al+District+%234
>
> What's my work around? Complain to Mozilla? Same for Firefox BTW. I
> cannot change my field.
>

name attribute if type CDATA, so it should not be urlencoded, but
htmlspecialchars used instead.

But this is not necessery because of other restrictions for name and id
attributes:

http://www.w3.org/TR/REC-html40/types.html#type-cdata

 

Navigation:

[Reply to this 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

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