[PHP] escaping quotes in forms and redisplaying variables in form fields

2002-05-06 Thread John Hughes
I'm stumbling over how to allow people to put single or double quotes in a form text field. I am passing the form to itself ($PHP_SELF) and on the second time through previewing what the form data will look like and also re-creating the form with the data already filled in. Here's an example

Re: [PHP] escaping quotes in forms and redisplaying variables in form fields

2002-05-06 Thread Robert Cummings
See: http://www.php.net/manual/en/function.htmlspecialchars.php John Hughes wrote: I'm stumbling over how to allow people to put single or double quotes in a form text field. I am passing the form to itself ($PHP_SELF) and on the second time through previewing what the form data will

Re: [PHP] escaping quotes in forms and redisplaying variables in form fields

2002-05-06 Thread 1LT John W. Holmes
Yeah, you have to convert the single and double quotes to html entities so they are not mistaken for the end of the string. If you look at your source code, you'll see why it's happening. value = 'O'Bryan' value = Joe Bruiser Smith You can see how the 'O' is taken as the string, and the rest