How to add only refferrring url to message?

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?

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/

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?

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.

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:

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?

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.

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

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.