You are here: Re: stripslashes problem (American Inch Marks = ") « PHP Programming Language « IT news, forums, messages
Re: stripslashes problem (American Inch Marks = ")

Posted by Andy Jeffries on 05/18/06 18:39

On Thu, 18 May 2006 10:20:17 -0500, Terry wrote:
> <input type=\"text\" id=\"grip\"
> name=\"grip\" maxlength=\"60\" size=\"60\" value=\"$row[4]\">
>
> $description will display whatever is entered ' and " $grip will
> truncate anything after the " when the record comes up for modification.

The answer is simple, your content contains a " and the HTML attribute
uses " to contain the value. So effectively you have this:

value="12" racket"

So the value trims after 12 and then has racket" after it.

There are two ways round this:

1) Hacky - use value='$row[4]' which will allow you to use " within the
data

2) Better - use htmlentities on the data before displaying it for editing
using ENT_QUOTES to convert quotes to HTML entities. Browsers will
display the proper character and allow editing as if it's a single
character.

Cheers,


Andy


--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация