Solved

Should I undo html special chars?

Posted on 2013-12-10
4
292 Views
Last Modified: 2013-12-10
I set up a simple contact/email form with php verification.

In a contact form I set up should I undo html special chars when the message is sent to the office so that customer messages aren't altered?

What is industry standard?
0
Comment
Question by:burnedfaceless
  • 3
4 Comments
 
LVL 13

Accepted Solution

by:
Carl Bohman earned 500 total points
ID: 39708977
If you have a simple form, you are likely just taking in plain text, right?  There shouldn't be a need to undo special characters in a case like that, since there won't be any.

However, if what you are concerned about is a user embedding malicious code in their message, then I would go ahead and escape everything they submit using a standard function (like PHP's htmlspecialchars) to prevent execution.  Just keep in mind that you will then need to unescape it to use it in a text-only context.
0
 

Author Comment

by:burnedfaceless
ID: 39708982
How do you unescape it? And in what part of the process do you do this?
0
 

Author Comment

by:burnedfaceless
ID: 39708987
I guess before you mail it?
0
 

Author Comment

by:burnedfaceless
ID: 39708988
I'm just going to leave it. If I tweak it too much I'll have to keep my email in it longer.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
mysqli_connect error on wamp but not on remote server 8 37
parse url to form? 7 25
IP 10.0.1.2 / 255.0.0.0 61 56
Use Select Query to Return Results as a Form 9 24
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question