Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1205
  • Last Modified:

.php insert text in mysql / strange characters

Hi,

I would like to add text into mysql, but there is something fishy going on.
When i try to put this word into mysql: geïsoleerd

it changes into:  geïsoleerd

Note:
When submitted here, the values above change. The first word has an i with double dots.
The second has a capital A with an ~ on top and a High line.

Never had this problem before. Anyone knows what's going on?
0
dwax
Asked:
dwax
  • 3
1 Solution
 
dwaxAuthor Commented:

Hmm aparently the same issue appear here...
0
 
psimationCommented:
try using htmlspecialchars() function to "encode" your text BEFORE you write it to the DB, or at least before you echo it to screen in a browser.
0
 
dwaxAuthor Commented:

Thanks for your reply.
I did try htmlspecialchars(),   but it doesn't change it.

Never had this problem. This forum also suffers from this thing.
Any other ideas?
0
 
dwaxAuthor Commented:

Okay, found the solution :
$Text = htmlentities(utf8_decode($_POST['Text']));

That does the trick!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now