Referral capture form?

15 posts by 4 authors in: Forums > CMS Builder
Last Post: November 9, 2015   (RSS)

By Toledoh - November 4, 2015

Mmm.  Still doesn't seem to work Dave...  I keep getting the latest referrer, not the original.

Cheers,

Tim (toledoh.com.au)

By Dave - November 5, 2015

Hi Tim, 

Viewing source seems to show the correct value (the oldest referrer) in the hidden field.  

It may be your form tag: 

<form method="POST" action="" class="form-horizontal" role="form"/>

Because it has an action of "" it will submit to the current url, which may be ?referrer=whatever and then when PHP runs it may combine the ?referrer from the URL and the hidden field and give priority to the one in the URL.

Can you try changing your form action to ? as in: 

<form method="POST" action="?" class="form-horizontal" role="form"/>

Let me know if that works for you.

Dave Edis - Senior Developer
interactivetools.com

By Toledoh - November 5, 2015

Sorry Dave - now I get no data captured in the "referrer" field... however the other standard fields "name, email, message" come through.  I cleared my cookies initially to see if it was remembering that the first time I went there I went with out any referrer... but not win.

Cheers,

Tim (toledoh.com.au)

By Dave - November 6, 2015

Hi Tim, 

There might be something in the rest of your code that is interfering, try this updated script and see if it works exactly as intended on it's own and then try to integrate it.

I've renamed the variable returned and submitted to $oldestReferrer so it's clear what it is and it's distinct from the incoming referrer.  And this update form shows what's being set, what's being submitted by the form, etc.

Let me know if the example form is working as intended.

Dave Edis - Senior Developer
interactivetools.com