Re: MySQL / PHP / Escaping the "

by "Darrell King" <darrell(at)webctr.com>

 Date:  Tue, 11 Jun 2002 06:53:41 -0400
 To:  <hwg-techniques(at)hwg.org>
 References:  upwebmaestro
  todo: View Thread, Original
value="<?=htmlentities($quoted_variable)?>"

http://www.php.net/manual/en/function.htmlentities.php

D

----- Original Message ----- 
From: Nathan Lyle 

Anyway, my problem is this. I'm using PHP to sculpt a page around the
results of a MySQL query (great so far) but I'm not sure how to handle
results from MySQL with quotes in them. For example, one field is
"dimension" which can have values like: 2" x 30" x 1'

When I toss that value into a line attempting to display a form field,
the resulting html thinks the first quote in the value is the end
quote for the form vield "value" attribute.

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA