【发布时间】:2018-04-04 20:43:11
【问题描述】:
我有一个表单,在提交表单时会向我发送一封电子邮件。我添加了一个隐藏字段,显示表单是从哪个 URL 提交的。这段代码:
add_filter('frm_get_default_value', 'my_custom_default_value', 10, 2);
function my_custom_default_value($new_value, $field){
if($field->id == 84){ //ID of the hidden field
$new_value = $_SERVER['REQUEST_URI']; //stores the value of the URL
}
return $new_value;
}
正在我的电子邮件中打印:/tour/australia
但我希望将印刷材料作为这样的链接:https://example.com/tour/australia。我试图用下面的代码解决这个问题:
add_filter('frm_get_default_value', 'my_custom_default_value', 10, 2);
function my_custom_default_value($new_value, $field){
if($field->id == 84){ //ID of the hidden field
$new_value = $_SERVER['<a href="https://example.com">REQUEST_URI</a>']; //stores the value of the URL
}
return $new_value;
}
但我无法使用此代码打印任何内容。有人可以帮我解决这个问题吗?
最好的问候
【问题讨论】:
-
我相信这可以帮助你。 Help
-
感谢您的评论。我只是在那里尝试了不同的建议,但我无法让它发挥作用。我仍然得到相同的打印出来
标签: php