...

View Full Version : Escaping quotes in html forms



trias
01-21-2004, 12: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?

liorean
01-21-2004, 12: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.

trias
01-21-2004, 10: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?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum