I am having some problems with the following and character encoding. I have tried to use htmlentities which you will see in the example below but it keeps printing out the following:
ääää
Here is my code:
<?php
$ud_mon=htmlentities($_POST['ud_mon'], null, "UTF-8");
$ud_dien=$_POST['ud_dien'];
$ud_mit=$_POST['ud_mit'];
$ud_don=$_POST['ud_don'];
$ud_fre=$_POST['ud_fre'];
$username="root";
$password="passwd";
$database="mydb";
mysql_connect(localhost,$username,$password);
mysql_select_db($database);
$query="UPDATE essen SET 'mon=$ud_mon', dien='$ud_dien', mit='$ud_mit', don='$ud_don', fre='$ud_fre' WHERE id=2";
mysql_query($query);
echo "essen Updated";
mysql_close();
?>
Here is one of the form input boxes:
<input name="ud_mon" class="element text large" type="text" maxlength="255" value="<? echo htmlentities($mon); ?>"/>
Any ideas?