Ah! I knew there was an easy fix to this. Thank you! You have helped me immensely!
Suzi --- In php-list@yahoogroups.com, James Keeline <[EMAIL PROTECTED]> wrote: > > --- Suzi <[EMAIL PROTECTED]> wrote: > > > I am working with PHP and MySQL. I have a form to edit data existing > > in the database. When viewing the form, one of the fields has data > > that will contain quotation marks. If I pull this into the form in a > > textfield from the database with <? echo $kddim ?> or <?=$kddim?> it > > truncates at the point where the quotation mark exists. > > > > Is there a way around this? I cannot use backslashes in the database > > because they show in the page output. The only place it truncates in > > when outputting the data to the textfield in the form for editing. > > > > Any solutions? > > > > Suzi > > You should store the information in the tables with backslashes using either addslashes() or > mysql_real_escape_string(). After pulling the information back out of the table you can use > stripslashes() to remove the backslashes before displaying the content. > > Also, if using a text input field you will probably want to use htmlentities(stripslashes($X)) on > your values. The htmlentities() function transforms many special characters, including items like > the double quote (") to an item which the browsers can reliably display ("). > > James > _____ > > > James D. Keeline > http://www.Keeline.com http://www.Keeline.com/articles > http://Stratemeyer.org http://www.Keeline.com/TSCollection > > http://www.ITeachPHP.com -- Free Computer Classes: Linux, PHP, etc. > Spring Semester January-June 2006. Two new class topics. > Community email addresses: Post message: php-list@yahoogroups.com 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/