RE: mozilla & urlencode

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

 



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

I'm not sure, but I see two things that might be causing this.  First, why are spaces, which should be translated as %20, being represented as a '+'?

Second, you have a # in the actual bookmark name, which I would assume is not valid since the # denotes the beginning of a bookmark.  So perhaps IE compensates for this, but Mozilla reads the bookmark as looking for <a name="4"></a> because of the #4 at the end of the bookmark name.

HTH,

Pablo

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