It looks as if you have magic_quotes_gpc enabled. Either disable it via php.ini or an .htaccess
directive. If you can't do that, make a quick google search for something along the lines of
stripslashes deep, and apply that to the $_GET and $_POST superglobals as early as possible.
On 13/06/2009 11:41 AM, Jalil F. wrote:
I have a simple form and save some text to the database. I use code like the
following in my form:
$names = new Zend_Form_Element_Text('names');
$names->setLabel('Names:')
->setRequired(true)
->addFilter('StripTags')
->addFilter('StringTrim')
->addValidator('NotEmpty');
And then save the data using a simple model object in my controller like
this:
$books = new Books();
$row = $books->createRow();
$row->names = $form->getValue('names');
$row->save();
and then read it back using fetchrow() function of my Books model object.
I noticed that when my data has special characters like ' it is escaped with
a \. For example, it's is returned to me as it\'s.
Where is this happening exactly? Also, what is the best way to get the exact
text that I entered back?
-J