标题:
内容:
我想对表单验证,原来没有问题,但在htm加入这段javascript出现smarty错误,和smarty有什么关系啊?
回复讨论(解决方案) js 代码被当做模板解释了吧?
js 代码被当做模板解释了吧?
那应该怎么修改呢
include ('./global.php');if($_post['submit']){ $sql=insert into `message`(`id`, `user`, `title`, `content`, `lastdate`) . values ('','$_post[user]','$_post[title]','$_post[content]',now()); $query=$db->query($sql); echo ;}$smarty->display(message.htm);
在php文件里能获取htm表单的各个属性值吗?
请使用literal标签,包含js块
http://smarty.jz123.cn/language.function.literal.html