What you also need is to htmlspecialchars() the vars that you echo as form
element values, else your HTML will be broken if one of the vars contains "
. This should work for both text fields and textareas


<input type="text" value="<?=htmlspecialchars($var)?>">

or

<textarea><?=htmlspecialchars($var)?></textarea>



-----Original Message-----
From: Lso . [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 4:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] quotes


Ok I have been searching to no avail.   I have a form that lets you add new
sets of information to a database.  Once you add information i have a page
that displays this information in a series of text fields.  I have done this
so you can alter the information in the fields hit edit and the information
is updated, you are brought back to the same page and there you see your
updated information.  This all works fine.  The problem is if the usere
enters a quote.  I have used addslashes(), and the information is entered
fine, but when I display the information in the form fields its cut off
right after the  quote.  I tried stripslashes() didnt work.  If i url encode
the input i get the html entity displayed in the form field.  Does anyone
have any suggestions?  Im just trying to make a nice interface for editing
this data.  Thanks in advance.

Lucas Owens
www.lucasowens.com
www.technoiraudio.com

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to