Author Topic: How to get referrer from a form?  (Read 1704 times)

Offline timlight10

  • Full Member
  • ***
  • Posts: 124
  • Karma: +15/-1
    • View Profile
    • Dedicated Presentation Solutions
How to get referrer from a form?
« on: September 05, 2022, 02:48:51 PM »
I have added a form with Admin > Design > Forms Manager for customers to request a custom quote on a product. It appears on all of my product pages. I would like to have the page URL where the form was submitted to come to me in the e-mail when user clicks submit.

I have tried to add a "hidden" field with Field Value $_SERVER['HTTP_REFERER'] but that did not work.

Any suggestions?

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2046
  • Karma: +318/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: How to get referrer from a form?
« Reply #1 on: September 06, 2022, 01:48:35 AM »
try to use session. Set some value (current product url into $this->session->data['product_url']) and set it into your hidden field in the form
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline timlight10

  • Full Member
  • ***
  • Posts: 124
  • Karma: +15/-1
    • View Profile
    • Dedicated Presentation Solutions
Re: How to get referrer from a form?
« Reply #2 on: September 06, 2022, 10:09:52 AM »
Nope, that doesn't work either. I just get the text "$this->session->data['product_url']" back.

Offline timlight10

  • Full Member
  • ***
  • Posts: 124
  • Karma: +15/-1
    • View Profile
    • Dedicated Presentation Solutions
Re: How to get referrer from a form?
« Reply #3 on: September 12, 2022, 08:41:08 AM »
Any other suggestions?

 

Powered by SMFPacks Social Login Mod