Forum Moderators: coopster
If you build the form page in PHP, you could always put the referrer into the form data as a hidden field, having grabbed the referrer at that point.
EG:-
<form>
<?
<input type=\"hidden\" name=\"referrer\" value=".$HTTP_REFERER."\">";
?>
<rest of form fields>
</form>
.... would then send the referrer in the form data and you can log it/action on it at the form script end.
TJ
I guess you could set first off-domain entry point referrer in a cookie.
WARNING : I'm not really a php coder, more of a copy/paster ;) but I think it could go something like this:-
if ($_COOKIE['FormReferrer'] == '') AND ($_COOKIE['FormReferrer']!= 'www.yourdomain.com**') {
setcookie('FormReferrer', $HTTP_REFERRER);
}
** - you'd need to RegEx that bit...
Then in the form:-
<text type="hidden" name="referrer" value=".$_COOKIE['FormReferrer'].">";
//Reset the cookie
setcookie('FormReferrer', '');
//.... OR just time it out
TJ
For the sake of completeness, I'm going to fix my own bug in the first line, which should of course read:-
if ($_COOKIE['FormReferrer'] == '') AND $HTTP_REFERRER!= 'www.yourdomain.com**') {
setcookie('FormReferrer', $HTTP_REFERRER);