Skip to main content
Participating Frequently
June 27, 2006
Question

PHP/MySQL & HTML quote conflict

  • June 27, 2006
  • 1 reply
  • 394 views
I'm working on an update form for a PHP/MySQL database in DreamweaverMX2004. One particular piece of data includes quote marks to indicate inches for a size (i.e. '25"w x 32"h', see code below). When the server tries to insert that text into the "value" field in the form element, it reads the first quote mark within the data as the end quote mark for the value field. So, rather than '25"w x 32"h' appearing in the update field, I get '25'. How do I get around this? I need to keep the quotes in the data.

<input name="size" type="text" id="size" value="<?php echo $row_Recordset1['size']; ?>">
This topic has been closed for replies.

1 reply

Inspiring
June 27, 2006
Skinny Guy 76 wrote:
> One particular piece of data includes quote marks to indicate inches for a size
> (i.e. '25"w x 32"h', see code below).
>
> <input name="size" type="text" id="size" value="<?php echo
> $row_Recordset1['size']; ?>">

value="<?php echo htmlentities($row_Recordset1['size']); ?>"

--
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/