Firefox problem

  harristweed 08:28 09 Nov 2006
Locked

I use a link to pass a variable to the next page for use in a database search. i.e. ………. nextpage.php?link=townname /a>

Pretty standard stuff, however if the town is in Spain it may have a foreign character in it, Cádiz for example.

In I.E. the link would show in the address bar as ….nextpage.php?link= Cádiz
and that works fine.

However in Firefox it shows as ….nextpage.php?link= C%C3%A1diz

The foreign character s replaced with a code generated by the browser.

I can get around this using the php function ‘str_replace’. However this is just a workaround. Has anybody got any better Ideas?

  Eric10 10:34 09 Nov 2006

I've never worked with php so I may be talking rubbish but does it understand HTML characters? For instance in HTML the á is represented by á so maybe 'Cádiz' would work. If this does work then click here for a list of special characters in HTML.

  Eric10 10:37 09 Nov 2006

Okay! that's not how it should have come out. Remove the spaces & aacute ; or look at the link.

  harristweed 11:52 09 Nov 2006

Thanks for the reply Eric. I can’t modify the special characters easily as they are from an XML feed.

However PHP is not really relevant to the problem, as it’s the link text that Is causing the problem and that is taken from a ‘MYSQL’ database.

I’m going to try specifying the encoding with
< meta http-equiv="Content-Type" content="text/html; encoding="ISO-8859-1"/ >

  acsmanhtml12 16:51 09 Nov 2006

It's probably just firefox display it as it should.

  harristweed 12:40 10 Nov 2006

Specifying the encoding made no difference

  beynac 14:45 10 Nov 2006

I've just tried it using IE7 and then Firefox v2. It worked in both browsers. The only difference I had was that the link shown in the Firefox address bar was: nextpage.php?link=C%E1diz and not as you have above.

The page had doctype as: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"click here">

and charset=iso-8859-1

  beynac 14:53 10 Nov 2006

... that didn't use the variable in a database search. However, I did check that it came through correctly by using the following code:

if ($Town == "Cádiz") {
print ("Town is Cádiz\n");
print ("Town is $Town\n");
} else {
print ("Didn't work!!!\n");
}

It printed:

Town is Cádiz Town is Cádiz

  harristweed 09:15 11 Nov 2006

Thats helped me. I was using Firefox 1 Beta. ( I didn't know Firefox 2 was available!). I upgraded to Firefox 2 and the address bar display changed to the same as you described and the search worked, as suggested by your test code.

Many thanks.

Harristweed

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Fujitsu Lifebook P727 laptop review

Microsoft Paint set to die after 32 years

Mac power user tips and hidden tricks

Comment désactiver la saisie intuitive et paramétrer votre clavier ?