使用我的插件从前端提交表单数据以存储在wordpress数据库中时出错

时间:2019-04-13 17:37:20

标签: wordpress

我写了一个插件代码。我想在我喜欢的每个页面上使用我的插件编写的短代码显示自定义表单。插件和表单正确显示,但是提交并处理了要存储在数据库页面上的数据后,未发现错误。从前端向后端提交数据的最佳方法是什么?

// 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>

1 个答案:

答案 0 :(得分:0)

由于输入名称而发生错误:    我认为它是保留的或类似的东西。 改变解决了我的问题。