Click to See Complete Forum and Search --> : £ - whats this?


speed1972
06-28-2009, 05:27 PM
When i submit a form the pound sign gets emailed to me like this £. How do i fix it?

WebWarrior
06-28-2009, 08:45 PM
You must provide more details about your Website. What type of encoding are you using i.e. UTF-8, ISO-8859-1, etc...? In UTF-8 you can use £ special character.

Charles
06-29-2009, 06:29 AM
In UTF-8 you can use £ special character.That's not at all true but we do need more detail. A link to the document would be nice.

speed1972
06-29-2009, 10:49 AM
Here is a link to the page in question http://www.elitetradesmen.com/Job%20descriptions/101.php

WebWarrior
06-29-2009, 04:39 PM
That's not at all true but we do need more detail. A link to the document would be nice.
You mean not entirely true. The speed1972's case is a classic example of UTF-8 served as ISO-8859-1.
Your Website uses UTF-8 encoding, so perhaps the problem lies in your e-mail sending code. If you are sending e-mail as text/html, then make sure that you provide UTF-8 encoding as part of the headers (i.e. "Content-type:text/html;charset=utf-8").

speed1972
06-29-2009, 05:12 PM
I found this on my form, does this look right. It still doesn't send the £ sign correctly

//$mail_message = stripslashes($mail_message);
$senders_email = preg_replace("/[^a-zA-Z0-9s.@-_]/", "-", $senders_email);
$senders_name = preg_replace("/[^a-zA-Z0-9s]/", " ", $senders_name);
$headers = "From: $senders_name <$senders_email> \r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type:text/html;charset=utf-8";
$headers .= "X-Mailer: Mailscript by Dave Hayward http://www.megaginge.info megaginge@gmail.com \r\n";
mail($sendto_email, $mail_subject, $mail_message, $headers);

WebWarrior
06-29-2009, 07:59 PM
First, add "\r\n" to your $headers .= "Content-type:text/html;charset=utf-8";
i.e. $headers .= "Content-type:text/html;charset=utf-8\r\n";

Where does the pound sign originate from? I don't see it anywhere on the form. Do you append it to your message inside PHP file?