高手请帮我看下这个

高手请帮我看下这个

<?php
$host="localhost";
$username="root";
$password="123456";
$datebase="msg";
$conn=mysql_connect($host,$username,$password);
mysql_select_db($datebase,$conn);
mysql_query("SET NAMES 'GBK'");
$content=$_POST['content'];
$sql="insert into new_message
(content,time)
values
('$content',now())";
$rs=mysql_query($sql);
if ($rs){
        echo "<script language=javascript>alert('留言成功了!');</script>";
}
else{
"<script language=javascript>alert{'留言失败!'};</script>";
}
?>
<script language="javascript">
function Checkpost(){
        if(myform.content.value.length<5)
        alert('留言内容不可以小于5个');
        return false;        
}
</script>
<form method="POST" name="myform" action="message.php">
<textarea name="content" id="content" cols="30" rows="6"></textarea><br>
      <input type="submit" name="submit" value="发表留言">
</form>
我想请问下这代码哪地方有问题啊!谢谢,我在等啊!!!

<form method="POST" name="myform" action="message.php" onsubmit="return Checkpost();">

你这样都是返回 false。应该这样写
function Checkpost(){
        if(myform.content.value.length<5){
            alert('留言内容不可以小于5个');
            return false;        
       }
}
如履薄冰