在联系表7(Wordpress)中使用PHP

问题描述 投票:-1回答:1

我想在我的使用Contact Form 7(WordPress插件)创建的表单中添加一些PHP。我已经尝试过了,但是没有用:Executing PHP Code in Contact Form 7 Textarea。每次插入该函数时,我的网站都会崩溃。

我在$ _SESSION中存储了一个变量。我已将该变量放入隐藏的输入中,现在我想获取隐藏输入的值并将其放在联系表中。我怎样才能做到这一点?谢谢!

Screenshot of the website and the hidden input

Screenshot of the back-end of the form

php wordpress contact-form-7
1个回答
0
投票

我认为这种方法对您有用。

  1. 设置链接的URL参数。范例domain.com/more-info?previous-link=home-page
  2. 在您的表单中添加此字段

    [text* previous-link default:get default:post_meta "Previous link"]
    

您可以在docs中找到更多示例

© www.soinside.com 2019 - 2024. All rights reserved.