wordpress - 使用我的插件从前端提交表单数据以存储在 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>
解决方案
由于输入名称而发生错误:我认为它是保留的或类似的东西。改变这解决了我的问题。
推荐阅读
- vue.js - vue cli 全局主体样式不包含在构建中
- android-studio - 此计算机不支持 Intel 虚拟化技术 (VT-x) 或被 Hyper-V 错误独占使用
- jsf - 如何关闭 websocket 服务器端点和会话范围的支持 bean 之间的差距
- .net - Nuget - 是否需要重新安装标有 requireReinstallation 问题的软件包?
- android-studio - Android Studio 将无限更新且不会停止
- matrix - 对于大型矩阵,Lua 中的一维或二维数组的计算效率更高吗?
- hybris - 如何在 Hybris 中限制插入?
- java - 在运行时覆盖`spring.cloud.config.profile`
- bash - 如何抑制shell脚本中的命令输出?
- ms-access - 在 Access 2013 上的表单中添加滚动