In the HTML output of a PHP script, I have an input field which contains a value which has previously been set by the user. My problem is that this value could contain a " or a '. Since the value of the field needs to be surrounded by quotes in the HTML, it doesn't work when people have previously entered quotes as this value.
I've tried getting PHP to put a \ before the quotes but this doesn't work in HTML, and if I replace the quotes with say the ' code which makes a ', that text shows up in the input field.
Other than javascript, anyone know a way around this?