htmlentities is producing all these signs ... :)
i'd not use them to store the data in the database, a addslashes should be
enough
use htmlentities after having extracted the data from the db again...

>>I do this with code before into database:
>>------------------------------------------------------------
$beschrijving = addslashes($beschrijving);

>>this piece of code is in the form (the <br> will be pulled out first)
>>--------------------------------------------------------------------------
--
-------------------
<? $beschrijving = htmlentities(stripslashes($beschrijving));
<textarea name="beschrijving" rows="10" cols="50"><? echo $beschrijving
?></textarea>

and if you want to get rid of the newline characters:

>>I do this with code before into database:
>>------------------------------------------------------------
$beschrijving = addslashes(str_replace("\n", "", $beschrijving));

anyone tell me in case i'm wrong *gg* :)

Tomy Wagner







----- Original Message -----
From: "Marij Bellen" <[EMAIL PROTECTED]>
To: "Php-Db@Lists. Php.Net (E-mail)" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, April 10, 2002 1:00 PM
Subject: [PHP-DB] Grrr quotes


> Hello, i have a little problem with quotes:
>
> - first a have a textarea in a form
> - second i'm gonna check this textarea
> - if all checks sussesfull I process the data, so no straings thing get in
> my database or whatever (function see below)
>
> Problem: if I get the data out of the database I sometimes get problems
that
> make funny '&' characters of quotes and if im wright also from alt-keys
> (like for example a euro-sign ).
>
> EUR -> &#8364;
>
> I do this with code before into database:
> ------------------------------------------------------------
> $beschrijving = ereg_replace("\n","<br>", ereg_replace("`","
> ",htmlentities("$beschrijving")));
>
>
> this piece of code is in the form (the <br> will be pulled out first)
> --------------------------------------------------------------------------
--
> -------------------
> <? $beschrijving = ereg_replace("<br>", "", $beschrijving); ?>
> <textarea name="beschrijving" rows="10" cols="50"><? echo $beschrijving
> ?></textarea>
>
>
> How is it possible i get these funny &-signs.
> I think it has something to do with the htmlentities() i'm using.
> Is there a way to translate them back or something?
>
> Thanks
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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

Reply via email to