RE: [PHP] quotes

From: Date: Wed, 25 Jun 2003 15:41:36 +0000
Subject: RE: [PHP] quotes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-152793@lists.php.net to get a copy of this message
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:lukas__scott@hotmail.com] Sent: Wednesday, June 25, 2003 4:21 PM To: php-general@lists.php.net 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

« previous php.general (#152793) next »