0

First time posting, new web designer here. I'm creating a new landing page for a university (https://uab.edu/give/now/evergive). In the past, when we've created pages, we use &referrer. The new page I've created acts as a landing page, so we'd attach the referrer to the end and end up with a URL like this : https://www.uab.edu/give/now/evergive?referrer=AFEM1 Trouble is, it doesn't pass the referrer to the next page when you select a fund. I don't have a way to touch the form (it's being controlled by another department), so how can I pass the referrer value to the second page?

---EDIT!---

I realize I failed to mention the &referrer in question comes from social & email links (we're getting their analytics set up.)

  • Welcome to Stack Overflow! Please read this: https://stackoverflow.com/help/how-to-ask and try to improve your question. – flomei Nov 17 '15 at 23:42
  • If you need it to be passed around all pages, you probably wanna set a cookie instead, or you have to write a lot of code to make sure your links add that query parameter – Ruan Mendes Nov 18 '15 at 16:07

1 Answers1

1

Have you thought about just getting the HTTP referer header? For example, when I visit a link, my browser sends the following HTTP headers:

GET / HTTP/1.1
Host: stackoverflow.com
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
DNT: 1
Referer: http://stackoverflow.com/questions/5129624/convert-js-date-time-to-mysql-datetime
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Cookie: { Redacted }

See the referer header?

You can get this in PHP $_SERVER['HTTP_REFERER'] and JS document.referrer.

apscience
  • 7,033
  • 11
  • 55
  • 89