dongyu9263 2016-10-18 07:05
浏览 220

自定义wordpress表单提交

I want to insert data into database table through custom php form in wordpress. I don't want to use/create plugins/hooks. just simple form for client so he can edit himself whenever he want.

I tried

if($_POST['submit'])
{< submit to db >
} else {
< display html form ><br>
}


with action="" . this redirect to the same page without any error on page + in console. javascript validations on fields are working perfect.

I tried another solution by creating a php file in themes folder, and setting action="../that_file.php", which gave 404 error.

Any other solution?

  • 写回答

3条回答 默认 最新

  • duanfu7994 2016-10-18 08:23
    关注

    you have to follow the WordPress file structure like page.that_file.php under your theme folder and calling header and footer in it and hit the page to check it work or not. After checking it call the page in your action form still you get 404 than issue in your calling function.

    评论

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记