PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Email this page

  1. Hi there, my URL is riskwatch. I'm new to GF but it is mighty powerful! Here's what I'm trying to do. I have a fixed tab on the right side which says 'EMail This Page'. When someone clicks on it, I want them to be able to enter the email address of the person they wish to send it to, but in the body of the email I want to put the URL of the page they are ON, so the recipient of the email can either click on the link or copy/paste it in their browser. Here's what I've tried. I have the fixed tab set up in an HTML module (using Builder Default Theme). It is set up as an href=mailto: with the {referer} in the &body of the email. I created a form with a hidden field and under Advanced I selected HTTP Referer URL. I added the function; add action to my functions.php file like so:

    add_filter("gform_field_value_refurl", "referral_url");
    function referral_url($form){
    	//Grab URL from HTTP Server Var and put it into a variable
    	$refurl = $_SERVER['HTTP_REFERER'];
    
    	//Return that value to the form
    	return esc_url_raw($refurl);
    }

    As you can see, this doesn't work. Am I approaching this correctly? If not, could you please provide some step by step instructions that I could follow? Thank you in advance for your time and have a great day.
    Todd

    Posted 11 years ago on Saturday May 26, 2012 | Permalink
  2. Any Luck with this? I am trying to do a similar function with grabbing text from a HTML snippet that has a Javascript pulldown menu....
    Any feedback would be greatly appreciated

    Posted 11 years ago on Monday July 2, 2012 | Permalink
  3. David Peralty

    You shouldn't have to manually grab the URL. You should be able to use the merge tag for embed URL and get the result you are looking for.

    Posted 11 years ago on Tuesday July 3, 2012 | Permalink