Robert Griffith wrote:
>Hi Guys,
>
>I'm using QuickForm to put up a form. When I try to view my page,
>anything in the field is truncated at the apostrophe. It stores it
>properly in the database (and I used addslashes) so I can read
>everything. For example, if I put in "Don't keep me hanging on" the
>database record says, "Don\'t keep me hanging on" -- and in the field I
>am opening it just says "Don". :)
>
>Here's the code I am using to retrieve the data into the field:
>
>$form->addElement('text', 'title', 'Project Name / Title:','size=84
>value=\''.stripslashes($row['title']).'\'');
>
>If you look at the HTML that is produced with "Barbazon's hair salons,
>inc.", it says:
>
><input size="84" value="Barbazon" s="s" hair="hair" salons="salons"
>inc.="inc." name="title" type="text" />
>
>Now things only fall apart after the apostrophe. For example, a field
>a little farther down says:
>
><input size="84" value="Hair salons for a variety of men, women, and
>children!" name="summary" type="text" />
>
>I can't figure out how to get this thing working properly.
>
Hi Robert,
It seems to me you have the addslashes & stripslashes thing backwards.
Inside the database the slashes should be stripped off. Inside the form
the slashes should be added back on.
Rgds
Carl
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/