• 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: Get the URL of the page when submitting a form.

Get the URL of the page when submitting a form. 5 years 10 months ago #38145

I am planning to have the same form on different pages, but I would like to know the URL from where the form was submitted. Is there a way to achieve this?
Thanks in advance.
The administrator has disabled public write access.

Get the URL of the page when submitting a form. 5 years 10 months ago #38146

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 200
  • Thank you received: 48
could you not put a hidden field in the form with the default value of 'submitted from page x' then y0u could put {fieldame_name:value} in the admin email for each form?
If you can keep your head when all about you are losing theirs, then you obviously don't understand the situation!
The administrator has disabled public write access.

Get the URL of the page when submitting a form. 5 years 10 months ago #38161

This could be a solution, but wouldn't it defeat the purpose of creating one form for all the pages? Wouldn't adding a hidden field for the form with the name of the page requires the creation of many forms for the individual pages?
The administrator has disabled public write access.

Get the URL of the page when submitting a form. 5 years 10 months ago #38162

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 200
  • Thank you received: 48
unfortunately it would although it's a quick solution. If you'd had to duplicate to many forms it would be a bit unwieldy, two or three would be OK
If you can keep your head when all about you are losing theirs, then you obviously don't understand the situation!
The administrator has disabled public write access.

Get the URL of the page when submitting a form. 5 years 10 months ago #38164

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 200
  • Thank you received: 48
This works in the default value of a hidden field

//<code>
if(isset($_POST)){
return $_POST;
}else{
return $_SERVER;
}
//</code>

found it here:
www.rsjoomla.com/support/documentation/r...he-referer-page.html
If you can keep your head when all about you are losing theirs, then you obviously don't understand the situation!
The administrator has disabled public write access.

Get the URL of the page when submitting a form. 1 year 10 months ago #42043

  • StormIT
  • StormIT's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 30
I've tried this, added the following as a hidden field called URL:
//<code>
if(isset($_POST['form']['field_name'])){
return $_POST['form']['field_name'];
}else{
return $_SERVER['HTTP_REFERER'];
}
//</code>

But this isn't being captured when the form is submitted. Any ideas?
The administrator has disabled public write access.

Get the URL of the page when submitting a form. 1 year 10 months ago #42044

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 200
  • Thank you received: 48
Did you change the field_name?
if(isset($_POST['form']['url'])){
return $_POST['form']['url'];
}else{
return $_SERVER['HTTP_REFERER'];
}
If you can keep your head when all about you are losing theirs, then you obviously don't understand the situation!
Last Edit: 1 year 10 months ago by iceferret.
The administrator has disabled public write access.

Get the URL of the page when submitting a form. 1 year 10 months ago #42045

  • StormIT
  • StormIT's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 30
Yes, I did that but it's not capturing the data oddly
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!