View Full Version : Escaping quotes in html forms

01-21-2004, 01:05 AM
I need to pass a string through a html form. My strings may contain single or double quotes. How do I escape those quotes so that the entire string is captured for sending?

01-21-2004, 01:19 AM
If you mean that you want to include those in the HTML document, you just use " for double and ' for single quote. If you mean that you want to send them if the user enter them in a form, don't worry. The browser will encode them for you.

01-21-2004, 11:20 AM
Thanks extremely. :) You've pointed me in the right direction. Would the same be a good method for escaping double quotes in a MySQL INSERT INTO command where the values are delimited by double quotes but also have double quotes in them?