Hi,
I want to use a form on several pages but also want to get the referring url in the message, but I don’t want the other information included. So ”Append IP Address, Browser, and Referring URL to message” wouldn’t work.
Is this possible and how?
WordPress Forms
If not for you and Formidable Pro this project would not be possible with my budget. You've created the single best piece of software for Wordpress... period.
W Holmes (We Create You)Formidable is by far the best contact form I have seen for WordPress. It is easy to create and has had 0 issues with form deliveries. What makes Formidable unique is it’s ease of use and reporting capabilities. Takes all of the guess work out building a form.
Chris (Level3Logic)Copyright © 2013 Strategy11, LLC
October 5, 2012 at 8:40 am
You'll need to use custom code if you don't want to check that box. Here's an example:
http://formidablepro.com/help-desk/how-to-get-the-previous-url-tracking-data-using-post_title/
October 5, 2012 at 8:50 am
Hi,
could you clarify this a bit? I get that I shoudl add this code to the functions.php:
add_filter('frm_get_default_value', 'my_custom_default_value', 10, 2);
function my_custom_default_value($new_value, $field){
if($field->id == 25){ //change 25 to the ID of the field
$new_value = $_SERVER['HTTP_REFERER']; //set your custom value here
}
return $new_value;
}
But what is the field id (in this example $field->id == 25)
? How do I know which number and how can I add this information then to the submission message?
October 5, 2012 at 9:25 am
Here's a screenshot that shows where to find the ID of the field.
http://formidablepro.com/knowledgebase/insert-graphs-in-a-page-or-post/
Use the dropdown directly above the message box to insert values from specific fields.
October 5, 2012 at 11:19 am
Hi,
I'm not sure I understood.
I get something like mywebsitename.com/wp-admin/post.php?post=73&action=edit&message=6 in my email alert instead of my permalink which should be something like mywebsitename.com/test/
I did the following:
Added hidden field to form (and checked the Field Options id)
Used the Field Options id in the code to add to the functions.php:
October 5, 2012 at 11:30 am
When you say you want the referring url, what exactly are you after? This looks like you went from an admin page to the form page to submit an entry. Is this not the case?
October 5, 2012 at 11:51 am
That is the case, but the code isn't doing what I wanted it.
I want to use one form on a multisite on several pages of the website. So I use the same form on several websites and several pages. And when I get a submission I want to now which website and which page it came from.
So I wanted to add that in the form so that the information gets into the email notification.
October 5, 2012 at 12:06 pm
You'll need to replace $new_value = $_SERVER['HTTP_REFERER']; with something else. Please see Google for more detail.
https://www.google.com/search?q=server+current+url
October 5, 2012 at 1:09 pm
Thanks. For the archive. To get the full current url of the submission page you need to do the following.
1. Added hidden field to form. Take note of the Field Options id.
2. Add the Field Options id in the following code which you should add to the functions.php of your template:
/** code to get current url for Formidable Pro. */
add_filter('frm_get_default_value', 'my_custom_default_value', 10, 2);
function my_custom_default_value($new_value, $field){
if($field->id == 109){ //change 109 to the ID of the hidden field of your form
$new_value = $_SERVER["HTTP_HOST"].$_SERVER['REQUEST_URI'] ;
}
return $new_value;
}
Topic closed.