Cannot remove/encode the char '

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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. 

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux