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 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)
  • ¥20 matlab yalmip kkt 双层优化问题
  • ¥15 如何在3D高斯飞溅的渲染的场景中获得一个可控的旋转物体
  • ¥88 实在没有想法,需要个思路