nsForum logo

Welcome Guest ( Log In )

 
Reply to this topicStart new topic
> How To Get Mail Content Without Http Escape Codes?
BoBAgi
post Nov 8 2015, 04:32 AM
Post #1





Group: Verified NS Member
Posts: 37
Joined: 25-April 13
Member No.: 20,658



I have a few forms on the website which contain some user identification fields (like name, email, address etc) plus a text input box for the message to us.
The form is handled by a a php script and I have noticed that especially when people in certain countries fill in the form the resulting text in the email to our sales department is corrupted. Problem countries include Turkey but also from other countries I have seen this.

What happens is that there are a lot of the constructs below in the emails, both in name, address and body fields.
(I have had to enter spaces between the characters to make the codes visible in this post since the forum engine seems to convert them into the characters I also would like to see in the emails. Please remove the spaces on each item to see what is actually inside the emails):
CODE
& # 8 8 0 5;
& # 3 2 4;
& # 3 0 4;
& # 3 0 5;
& # 3 5 1;
& # 3 5 1;
etc

I am pretty sure the users do not enter these strange codes when they fill in the form...
I have tried to change the meta tag in the top of the form file as follows:
CODE
old tag:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
new tag:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

But doing so screws up the messages even more, now all accented characters entered (like ĺäöĹÄÖéč etc) become totally whacked. They are not even encoded with the codes like those shown above.

What can I do to get rid of this annoyance, which also affects an automatic form response parsing utility we use in teh office?
Go to the top of the page
 
+Quote Post
Craig
post Nov 8 2015, 08:12 PM
Post #2





Group: Administrators
Posts: 988
Joined: 23-June 08
From: Pennsylvania
Member No.: 1,317



QUOTE (BoBAgi @ Nov 8 2015, 05:32 AM) *
I have a few forms on the website which contain some user identification fields (like name, email, address etc) plus a text input box for the message to us.
The form is handled by a a php script and I have noticed that especially when people in certain countries fill in the form the resulting text in the email to our sales department is corrupted. Problem countries include Turkey but also from other countries I have seen this.

What happens is that there are a lot of the constructs below in the emails, both in name, address and body fields.
(I have had to enter spaces between the characters to make the codes visible in this post since the forum engine seems to convert them into the characters I also would like to see in the emails. Please remove the spaces on each item to see what is actually inside the emails):
CODE
& # 8 8 0 5;
& # 3 2 4;
& # 3 0 4;
& # 3 0 5;
& # 3 5 1;
& # 3 5 1;
etc

I am pretty sure the users do not enter these strange codes when they fill in the form...
I have tried to change the meta tag in the top of the form file as follows:
CODE
old tag:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
new tag:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

But doing so screws up the messages even more, now all accented characters entered (like ĺäöĹÄÖéč etc) become totally whacked. They are not even encoded with the codes like those shown above.

What can I do to get rid of this annoyance, which also affects an automatic form response parsing utility we use in teh office?

Those codes represent special characters. A reference for these charcters can be found at http://www.w3schools.com/html/html_symbols.asp. Your form processing script would need to filter out these characters. You should look at the documentation for sanitizing PHP variables (http://php.net/manual/en/filter.filters.sanitize.php).
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
Tags
No Tag inserted yet

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version    Network Solutions © 2011 Time is now: 23rd March 2017 - 07:05 AM
Domain Names | Web Hosting | Web Design | Shopping Cart Software | Online Marketing | SSL Certificates