首页 > 解决方案 > 使用我的插件从前端提交表单数据以存储在 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>

标签: wordpress

解决方案


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


推荐阅读