Can you please share which code you are trying to use and the snippet settings? That should help us point you in the right direction.
Thread Starter
nilayp
(@nilayp)
Hi, Thank you for support
here is my filter code
add_filter( 'gform_field_value_refurl', 'populate_referral_url');
function populate_referral_url( $form ){
// Grab URL from HTTP Server Var and put it into a variable
$refurl = $_SERVER['HTTP_REFERER'];
GFCommon::log_debug( __METHOD__ . "(): HTTP_REFERER value returned by the server: {$refurl}" );
// Return that value to the form
return esc_url_raw($refurl);
}
Here is code reference link: Capturing HTTP Referrer URL – Gravity Forms Documentation
-
This reply was modified 2 years, 2 months ago by
nilayp.
Hi @nilayp,
I think that’s expected – the code you are using there is dependent on the PHP code being executed, when the page is cached, you are viewing a HTML page that is cached from PHP.
To get around this you will have to exclude caching on the page where you are loading this form.
-
This reply was modified 2 years, 2 months ago by
Mircea Sandu. Reason: typo