Forum Moderators: coopster

Message Too Old, No Replies

i get an  before £ when i submit the form

         

Zeeshan

10:23 am on Sep 24, 2004 (gmt 0)

10+ Year Member



Hi,

I have a simple form on my page with a text box and a text area. When ever i put £ in the text box and submit the form, on the other page it shows an  sign before the £. So for example if I submit the form with this value in text box "Under £25". On the next page when i display the variable using PHP it shows me the value like this "Under £25".

I have tried this on my local system and it runs fine but i get this problem on the code uploaded on the hosting server.

follwing is the code for the form and the page where the form gets submited.

<form action="addtype1.php" method="GET" name="eform">
<table width="50%" border="1">
<tr>
<td>Type Name</td>
<td><input type="text" name="typename"></td>
</tr>
<tr>
<td valign="top">Type Description</td>
<td><textarea name="typedesc" cols="30" rows="5"></textarea></td>
</tr>
<tr>
<td valign="top">&nbsp;</td>
<td><input type="submit" value="Save Type"></td>
</tr>
</table>
</form>

<?

$typename = $_GET['typename'];

echo($typename);
?>

Longhaired Genius

10:33 am on Sep 24, 2004 (gmt 0)

10+ Year Member



I got this when I put:
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> on my pages, so I changed back to:
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">

I don't know why it happens, so if anyone has chapter-and-verse on this, I'd be interested too.

pete_m

10:58 am on Sep 24, 2004 (gmt 0)

10+ Year Member



I usually do a replace on pound signs - the html code is &pound;

ergophobe

3:58 pm on Sep 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It's a character encoding issue. I'm surprised that LHG had that happen, since code points for UTF-8 and ISO-8859-1 should be entirely overlapping for the IS)-8859-1 character set. In other cases, though, where the original is in Windows-1252 or a similar Mac character set or some other ISO-8859-* family, it is quite common.

For more info, try this threads
[webmasterworld.com...]

coopster has some additional links in the last post in that one.