Hi there,
I'm not a php developer so please bear with me.
I am having trouble inserting french charachters into my mysql database.
I spoke to my hosting co and they recommended using html_entity_decode in my php forms.
Is this easy to do, I am simply recieving for vars from a flash file and i guess I need
to convert the utf setting of them. Does this sound like the right route?
Any ideas or guidance would be really appreciated,
Dave
html_entity_decode
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
When you recieve the value, BEFORE adding it to the database use html_entities() to convert it to its &#xx; value.
This should also display in the web page too since HTML read entities and displays them fine. If you need to convert back to the prignal value for any reason use html_entity_decode()
EDIT | Sorry, that would be htmlentities() [No underscore like I posted above]
http://www.php.net/htmlentities
This should also display in the web page too since HTML read entities and displays them fine. If you need to convert back to the prignal value for any reason use html_entity_decode()
Code: Select all
$safe_insert_value = html_entities($_POST['var']); //Convert to entityhttp://www.php.net/htmlentities