When I want to input some Chinese character into my form,
<html>
<title>
Form
</title>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
</head>
<body>
<div id="wrapper">
<form action="form.php" method="post" accept-charset="UTF-8" >
<p>Input: <input type="text" name="input1" /></p>
<input type="submit" value="Submit" />
</form>
</div>
</body>
</html>`
and the form.php:
<?php
header('Content-Type: text/html; charset=utf-8');
define('DB_NAME','form1');
define('DB_USER','root');
define('DB_PASSWORD','');
define('DB_HOST','localhost');
$link= mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
if (!$link){
die('could not connect server'.mysql_error());
}
$db_selected = mysql_select_db(DB_NAME,$link);
if(!$db_selected){
die('Cannot connect'.DB_NAME.': '.mysql_error());
}
$value=$_POST['input1'];
$sql="INSERT INTO form (input1) VALUES ('$value')";
if (!mysql_query($sql)){
die('Error: '.mysql_error());
}
mysql_close();
header("Location: form.htm");
?>
Mysql sheet output something strange like 早਽ Why? Should I do something on the code or on Mysql? Please help!!!! Thanks!!!!!!