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 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?