Forum Moderators: phranque
We encourage them to link to the audio archive page, but many people tend to link directly to the audio. So when someone browsing their site clicks the link, their media player is launched and they are never taken to our site, so we are not given credit for providing the show.
What I'd like to do is create a script that would check to see where the user is at when they click the link to the audio. If they click on the link from our audio archive page, it takes them to the audio. If they click on that same link from anywhere else, then it takes them to the audio archive page so they can from there click on the audio.
My original thought was to use the HTTP_REFERER environment variable. I have heard that this is unreliable since the HTTP_REFERER variable may sometimes be left blank, or not contain the right information. If this is the case, then those users would never be taken to the audio.
Does anyone have any other suggestions on how I might accomplish this? How about having the audio archive page place a cookie on the user's machine, and then the script used to retrieve the audio would check for the existance of this cookie? Would that be more reliable than using the referer?