dongnai2804 2018-05-14 07:14
浏览 124
已采纳

Wordpress中的表单提交计数器

I have built my own contact form that sends an e-mail on submission with the information that the visitor has populated the form with. I have not used a plugin to create the form because I needed very specific functionality.

The last thing for me to do now is to create a counter that generates a unique number per form submission. This number is to be included as an order number of sorts in the e-mail that is sent from the form.

I have searched extensively, but my knowledge on this subject is limited. I therefore do not know quite what I am looking for. I think I need to do this in the Wordpress database for the number to be persistent.

How I can do this or where to start is the problem for me. Can someone point me towards a way to do this that is possible for a beginner?

All my code is now in a template file that loads on the Wordpress page that shows the form.

  • 写回答

1条回答 默认 最新

  • douwuli4512 2018-05-14 07:21
    关注

    If you saved the form inputs as a 'post type' before emailing, not only would you have a record in case the email goes astray, but WP would also generate a unique post id for the form.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 slam rangenet++配置
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊