• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Capturing referring URL

Capturing referring URL 14 years 9 months ago #11011

I feel a bit silly asking this, especially as it's specifically documented here(www.rsjoomla.com/customer-support/docume...he-referer-page.html). I upgraded to Pro thinking it was necessary to do this, but am now not sure as it still doesn't work for me.

All I want to do is capture the referring URL that lead the user to the form and pass it through in a hidden field. Is that possible in RSForm, and how? I've tried entering the following in the on-submission-scripts field, where 'ref' is the name of my hidden field, which has no default value. The variable 'ref' is coming through empty.:
if(isset($_POST['form']))
{
$_POST['form']['ref'] = $_SERVER['HTTP_REFERER'];
}
The administrator has disabled public write access.

Re:Capturing referring URL 14 years 9 months ago #11058

hiiiii



All I want to do is capture the referring URL that lead the user to the form and pass it through in a hidden field. Is that possible in RSForm, and how? I've tried entering the following in the on-submission-scripts field, where 'ref' is the name of my hidden field, which has no default value. The variable 'ref' is coming through empty.:


________________________
Want to get-on Google's first page and loads of traffic to your website? Hire a SEO Specialist from Ocean Groups  seo pecialist
The administrator has disabled public write access.

Re:Capturing referring URL 14 years 9 months ago #11067

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Hello,

The code mentioned in the documentation is available for RSform!Pro, not RSform!. Please note that scripts are not compatible.

You could try something like this instead (placed in the Scripts called on form display area):
foreach($fields as $i=>$field){
if($field->name == 'ref') 
$fields[$i]->default_value = $_SERVER['HTTP_REFERER'];
}
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!