<? session_start();
require_once('inc/conn.php');
require_once('inc/ls_syscode.php');
$opendb=new mydb();
$opendb->query("SET character_set_client = utf8");
$opendb->query("SET character_set_results = utf8");
$opendb->query("SET character_set_connection = utf8");

$code=$_POST["code"];
$id=$_POST["id"];
$comment=$_POST["comment"];


if(strtolower($code)!=strtolower($_SESSION['code'])){
	echo "e";
}else{
	$sql = sprintf("INSERT INTO ls_comments (cmtContent, proID) VALUES (%s,%s)",
		GetSQLValueString($comment, "text"),
		GetSQLValueString($id, "int")
	);
	if($opendb->query($sql)){
		echo 1;
		}else{
		echo 0;	
		}
}

?>