i need help with a form submit.
here is my code
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#form").submit(function(event) {
/* stop form from submitting normally */
event.preventDefault();
$.post( \'clase/app/add_meniu.php\', $("#form").serialize(),
function( data ) {
$("#status").append(data);
}
);
});
});
</script>
and here is the html
<form id="form" method="post" accept-charset="UTF-8" >
<fieldset>
<p>
<label>Denumire</label>
<input class="text-input small-input" type="text" name="text" maxlength="200" value="">
</p>
<p>
<label>Link</label>
<input class="text-input small-input" type="text" name="link" maxlength="200" value="">
</p>
here is the add_meniu.php code
require_once('../core/db.php');
$text=$_POST['text'];
$link=$_POST['link'];
$limba=$_POST['limba'];
echo'<div class="notification success png_bg">
<a href="#" class="close"><img src="resources/images/icons/cross_grey_small.png" title="Close this notification" alt="close" /></a>
<div>
Meniul '.$text.' a fost adaugat cu succes
</div>
</div>';
$query = "Insert into Meniu (Denumire,Link,ID_Limba) VALUES ('".$text."','".$link."','".$limba."')";
$result = mysql_query($query)
or die("query failed: " . mysql_error());
The thing is that in database when i insert info's from the external file "add_meniu.php" it doesnt insert it with UTF-8. I have my page, form and mysql table utf-8 , can you pls give me a solution?