网站优化

网站优化

Products

当前位置:首页 > 网站优化 >

Wordpress中的表单提交计数器

GG网络技术分享 2025-03-18 16:12 8


问题描述:

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.

图片转代码服务由CSDN问答提供

感谢您的意见,我们尽快改进~

功能建议

我已经建立了自己的联系表单,在提交时发送电子邮件,其中包含访问者填写的信息 形式与。 我没有使用插件来创建表单,因为我需要非常具体的功能。</ p>

我现在要做的最后一件事是创建一个计数器,每个表单提交生成一个唯一的数字。 此编号将作为从表单发送的电子邮件中的排序顺序包含在内。</ p>

我已经广泛搜索过,但我对此主题的了解有限。 因此,我不知道我在寻找什么。 我想我需要在Wordpress数据库中执行此操作以确保持久化数字。</ p>

我如何做到这一点或从哪里开始对我来说是个问题。 有人可以指出我可以为初学者做一个这样的方法吗?</ p>

我的所有代码现在都在一个模板文件中,该文件加载在显示表单的Wordpress页面上。</ p>

</ div>

网友观点:

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.

标签:

提交需求或反馈

Demand feedback