|
Posted by Kimmo Laine on 09/04/06 10:18
"Wim Cossement" <wcosseme@nospam.bcol.be> wrote in message
news:edgrbk$n4s$1@snic.vub.ac.be...
> Hello,
>
> I was wondering if there are a few good pages and/or examples on how to
> process form data correctly for putting it in a MySQL DB.
>
> Since I'm not used to using PHP a lot, I already found out that
> addslashes() can be used escape some characters, but I'm having some more
> problems with for instance δ, ε and ΅ (since the text is scientifical)
> Now some people also throw in htmlspecialchars() to convert those to HTML
> entities, but some nest htmlspecialchars() in addslashes() and others do
> the opposite.
>
> Is there a good and error proof way of ensuring that what one puts in a
> textarea gets stored and can be retrieved safe and sound?
>
Use Unicode for everything. Set utf-8 encoding to your database, save the
pages in utf-8, tell the browsers in every possibly imaginable way that you
are providing the content as utf-8. Not exactly easy process, but I
recommend you to try that.
--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti pδivittyvδ nettisarjis
spam@outolempi.net || Gedoon-S @ IRCnet || rot13(xvzzb@bhgbyrzcv.arg)
Navigation:
[Reply to this message]
|