Cannot remove/encode the char '

From: Date: Mon, 07 Apr 2003 15:07:29 +0000
Subject: Cannot remove/encode the char '
Groups: php.db 
Request: Send a blank email to php-db+get-26902@lists.php.net to get a copy of this message
I am having trouble removing or encoding the character ' from my variable before I write it to my database. I have tried the following methods so if anyone can point out where I am going wrong I would be grateful. Example. <textarea rows="2" cols="60" name = "formMemo" value = "<?=$formMemo?>"> <? $formMemo = addslashes($formMemo) ?> <? echo $formMemo ?></textarea> I Then stripslashes when the data is being retrieved from the database. Example 2. <textarea rows="2" cols="60" name = "formMemo" value = "<?=$formMemo?>"> <? echo htmlspecialchars($formMemo) ?> </textarea> Example 3. <textarea rows="2" cols="60" name = "formMemo" value = "<?=$formMemo?>"> <? echo htmlentities($formMemo, ENT_QUOTES, ISO-8859-1) ?> </textarea> I have also tried using str_replace("'", '&#039;', $formMemo) but everytime there is no change to the database value. Any ideas???? CONFIDENTIALITY NOTICE The information contained in this e-mail is intended only for the confidential use of the above named recipient. If you are not the intended recipient or person responsible for delivering it to the intended recipient, you have received this communication in error and must not distribute or copy it. Please accept the sender's apologies, notify the sender immediately by return e-mail and delete this communication. Thank you.

« previous php.db (#26902) next »