John Taylor-Johnston wrote:
This works: "District of St. Francis"
http://www.glquebec.org/tezt.php#District+of+St.+Francis
<a name="District+of+St.+Francis"></a>
This does not: "Montréal District #2"
http://www.glquebec.org/tezt.php#Montr%E9al+District+%232
<a name="Montr%E9al+District+%232"></a>
I'm beginning to see the problem lies with the French character "é". I
don't see it being #. In any case, I cannot change existing fields. How
can I get this working?
read:
http://www.w3.org/TR/REC-html40/struct/links.html#h-12.2.1
http://www.w3.org/TR/REC-html40/appendix/notes.html#non-ascii-chars
http://www.w3.org/TR/xhtml1/#h-4.10
http://www.w3.org/TR/xhtml1/#C_8
[w3c - confronting us daily with the fact that they are smarter than us :-)]
in short; only strings passing this regexp:
[A-Za-z][A-Za-z0-9:_.-]*
...are ok for use in the name attribute.
you will have to either change the data you have in the DB
or transform the text so that all non-ascii chars are replaced with
their ascii equivalent (e.g. é -> e) whenever you wish to use
the text in a name attribute.
and you can totally forget using the '#' in the value of a name attribute!
I don't know what kind of data entity the string 'Montréal District #2'
belongs to but maybe it has a keyfield (numeric is easiest here!) which
can be used to set the value of the name attribute.
good luck!
rgds,
Jochem
Pablo Gosse wrote:
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.
I generate the link using urlencode.
if ("" != $mydata->district){
echo " - <a
href=\"#".urlencode($mydata->district)."\">$mydata->district</a></h1>";
}else{
echo "</h1>";
}
The link is named:
echo "<hr size=1><a
name=\"".urlencode($mydata->district)."\"></a><h2>$mydata->district</h2>\n";
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php