我正在使用Codeigniter构建表单。Codeigniter:删除或更改表单按钮样式
提交按钮是:
echo form_submit('submit', 'Buy it', "id='bred'");
现在我处理在同一个PHP文件,它的形式是:
if (isset($_POST['submit'])) {
$query = "INSERT INTO table (product, price) VALUES ('$product', '$price')";
mysql_query($query)
or die(mysql_error());
//after inserting in the database I need to delete the submit button, so the form cannot be submitted twice
}
在我需要删除数据库/变化后插入将CSS设置为不透明度0 /更改CSS以显示无提交按钮,因此表单不能提交两次。
我该怎么做?
感谢
你为什么不处理在控制器的形式? –
您正在查询没有框架的方法,但使用旧的mysql_ *函数,而不是在模型中,除了在控制器之外处理表单。还有什么? –