我写了一个插件代码。我想在我喜欢的每个页面上使用我的插件编写的短代码显示自定义表单。插件和表单正确显示,但是提交并处理了要存储在数据库页面上的数据后,未发现错误。从前端向后端提交数据的最佳方法是什么?
// this is my shortcode function code:
<?php
if(isset($_POST['submit_btn']))
{
// inserting data to database process that currently ends with
// Page not found error.
}
?>
<form method="post">
<input type="text" name="name">
<input type="submit" name="submit_btn" value="Store">
</form>
答案 0 :(得分:0)
由于输入名称而发生错误: 我认为它是保留的或类似的东西。 改变解决了我的问题。